Question on making an actor "jump"
bartvicic
Member, PRO Posts: 14
I am currently trying very desperately to make something work in my game. Here goes: I want to have an actor change its speed to say, 300 (it has to change directly to that amount and not accelerate, otherwise i would have used the accelerate towards behavior) , whenever i touch the screen, and make it to travel towards wherever i pressed. When it has that speed (of 300) and direction (toward where ever i pressed) i want it to slow down by setting the drag to say, 100. The problem here is, that i dont know what formula to use for the linear velocity x and y. I will be sooo grateful if someone will solve this for me. Thank you for your time
Comments
Have you tried using the Change Velocity behavior? The direction would be the vectorToAngle of the touch X and Y position attributes, relative to scene.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yes I think tatiang is right if I understand what you are describing. If you want to move to a point on the screen then you don't want to use linear velocity, you want to use the angular velocity which is controlled by the Change Velocity Behavior.
www.rossmanbrosgames.com
Angular velocity controls rotation rather than liner movement.
Like tatiang says, use Change Velocity . . .
When mouse button is down:
--Change Velocity
Direction:
vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )
To set the Drag to 100 simply open the Physics attribute for the actor and enter 100 into the Drag value.
Have you tried to use interpolate? This might work
Interpolate doesn't use the physics engine so will not be effected by drag.
Solved! thank you for helping