How do i rotate a parachute based on movement of actor?
graapl
Member, PRO Posts: 29
So I have an player who moves (obviously) and I am making a parachute attach to his back when a key is pressed. I got the physics down, like the gravity pulls him up. But I still need some help with the image's rotation. I want it so when the actor (parachute or player) moves the image of the parachute will rotate in the opposite direction it is moving.
Any ideas?
Thanks!
Any ideas?
Thanks!
Comments
take the actors position and angle for the angle in the cos and sin rules, where D is distance between actor center and parachute center:
:
so make a game attribute parachuteX and in the actor do:
constrain game.parachuteX to actor.self.position.X + D*sin(self.rotation)
and make a game attribute parachuteY and in the actor do:
constrain game.parachuteY to actor.self.position.Y + D*cos(self.rotation)
and make a game attribute named rotation and in the actor do
constrain game.rotation to self.rotation
Then in the parachute constain X to game.parachuteX and Y to game.parachuteY and the rotation to the game attribute game.rotation.
It might look difficult but once you got the hang of it its actually doable. I was never good at math and do these things out of my head now
Lump Apps and My Assets
Sorry but that isn't what I am looking for. My actor is a ball that rotates so the parachute spins all over the place.
I'm looking for it to be pinned to the actor and rotate like it is being dragged in the wind.
I am really just confusing myself here