Need more constraining help!!!
Thanks to Some Sou Chefs for helping me keep one actor in the same spot as another. But i ran into a problem! my actor follows my other actor but my main actor rotates and the following actor doesnt. Hope that makes sense? is there any way i can keep my actor in one spot at ALL times even when rotated?
-Max
-Max
Comments
littleGuyx=distance offset * cos(mainDude Rotation)
(it basically gives the distance from the main dude horiz)
Constrain littleGuy Y to:
Y=distanceoffset * sin(mainDude rotation)
(to get the vertical)
Check this out, we are basically getting the adjacent angle on the X part and the opposite on the Y, since we know the hypotenuse, which is the distance offset that you specify.
http://www.mathsisfun.com/sine-cosine-tangent.html
@hotMagic Thank you I will definitely use this later on
For Y I got " game.smallship y=30*sin(game.Destroyer Rotation)"
Any Idea? What should I change?
-Max
So it would be smallShipX + (the formula you have above)
Because for example, in the example you give, the X would be at 0, not relevant to Big ship but to the screen.
Same for Y.
and smallShipY+( game.smallship y=30*sin(game.Destroyer Rotation)) For Y?