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.
  • Hi, im trying to get an object to be able to move ONLY in certain directions, but based on an angle rather than the limited 32 directions.

    So I can easily get the angle between 0-360 but im having trouble working out a way to move the active or any object ONLY along that angle.

    The angle will always be based on a right angle triangle so, basically the angle is the hypotenuse, but how to i actually setPosX and setPosY from an angle?

    Thanks
    Andy

    Parafly Paragliding Simulator Please login to see this link.

  • Observe:

    Please login to see this attachment.
    See how the things you want relate to the anatomy of a triangle that you learned at school?

    We've got the Hypotenuse (distance he'll be travelling), and the Angle.
    We want the Opposite (Y Axis) and Adjacent (X Axis):

    Now we apply SOH CAH TOA:

    Sine(Angle) = Opposite / Hypotenuse
    Cosine(Angle) = Adjacent / Hypotenuse

    ...So we can change that to:

    Opposite = Sine(Angle) * Hypotenuse
    Adjacent = Cosine(Angle) * Hypotenuse

    ...Which in terms of MMF becomes:

    Y Position = Old Y Position + Sin(Angle) * Speed
    X Position = Old Y Position + Cos(Angle) * Speed

    You may need to swap Sine and Cosine around, I haven't used MMF in ages but I have a feeling those two have to be swapped in MMF due to the fact that the origin is in the top left, not bottom left like it would be on a graph.

    You'll figure it out, I'm sure. :)

  • Hmm im still having issues, i guess its because of the extra im trying to do, ill try to explain so you have the bigger picture.

    All example move the object at an angle at SPEED, what i want to do is use the Xmouse position to move the object at the angle specified, so the object moves along the angle when you move the mouse.

    Its this bit that seems to be giving me odd results.

    Thanks
    Andy

    Parafly Paragliding Simulator Please login to see this link.

Participate now!

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