Is Direction Calculator: "Rotate object toward a position" supported?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I was taking a small break from Jarvis to do a little work on my small HTML5 shoot em up game and I ran into an issue with Direction Calculator:

    Basically I can't get the "Rotate object toward a position" action to work in my game after exporting it as a HTML5 game. It works just fine when running it from the editor and I get no warnings when I compile(no mention of unsupported extensions or conditions/actions) the project.

    Is this due to a unsupported feature or did I stumble upon a bug?

    Attaching an isolated case. When running from the editor the arrow object should chase the other active object but after exporting the project the arrow will just dart away.

  • Thanks for the confirmation Jeff!

    Sent off a bug report.

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

  • Hey Chrilley,
    in case you need to push forward your shooter meanwhile,
    this little nice expression does exactly the same:

    Atan2(Sin(angle_dest - angle_curr), Cos(angle_dest - angle_curr))

    will give you signed angle difference from angle_curr to angle_dest
    through shortest direction
    you can adapt/reuse it in the way you need to rotate your object towards the destination
    (i.e. divide by abs(itself) to get unitary angle step direction,
    multiply * rotation speed to rotate toward direction at certain speed, etc.)

    a selection of my Fusion examples can be found Please login to see this link.

  • Thanks schrodinger, I am not sure how I can apply it though. How do I get angle_dest? Is angle_curr simply the current angle?

    It would certainly be cool if these kind of formulas were built into Fusion 3's interface instead of extensions/plugins so people like me who can't math has a chance :)

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

  • I did get around it for now using Advanced Direction Object which got something similar to rotate objects.

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

  • Thanks schrodinger, I am not sure how I can apply it though. How do I get angle_dest? Is angle_curr simply the current angle?

    Just in case you or someone needs,

    angle_curr is current object's angle

    angle_dest is angle to target destination point

    you can get angle_dest with fusion's function OAngle("object",targetX,targetY) >> will give you a integer angle

    or with expression ATan2(Yobject-Ytarget,Xtarget-Xobject) >> will give you a floating point angle, more precision,
    very very slightly more processing time (unnoticeable below thousands iterations though)

    I noticed some issues in the past with ADO object for this (shaking through degrees a bit or even getting wrong directions)
    so if you hit any wall with that, you know there's a workaround XD

    a selection of my Fusion examples can be found Please login to see this link.

  • Thanks for explaining!

    I might give one of those expressions a try. After all the less extensions I have to use, the better I suppose. Unless ADO can do it faster, I have no idea how to measure that though :P

    I am using it for a missile barrage attack so if there's a hiccup in the direction calculation somewhere it probably wont be too noticeable(I haven't noticed thus far). Going for something like this: Please login to see this link. but with more missiles. Sort of like a power up that clears the screen :)

    Btw - where is OAngle? I can write it just fine in the expression editor but I cannot seem to find it in the interface.

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

  • Cool!
    Taking a break from Jarvis, huh X)
    That's an extensive project, I can see as taking a breath can be needful at some point to relief from that hard brilliant work.

    OAngle can be found inside the own object --> "Position" submenu (Angle of a vector)
    together with ODistance (Distance with a point)

    I guess "O" stands for "(this) Object"

    a selection of my Fusion examples can be found Please login to see this link.

  • Just a minor break, actually I am already back at Jarvis again but this game will be the little weekend project I do on the side. :)

    It was an old thing I just found the other day. It's almost a finished infinite space shooter game so I figured that I could brush it up and release as a free HTML5 arcade game somewhere.

    Edit: Oh so that's where OAngle was! I was wading through the Special Object's expressions and for some reason it never dawned on me that it could be on the actual active object!

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

    Edited once, last by chrilley (April 7, 2016 at 8:58 PM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!