# Problem with Physics behaviour

From the Asset Store
• Hey guys, i'm having a problem:

I'm doing a game where you can control the vertical position of an object like a plane (just vertical because the background will scroll continually at a constant speed).

Obviously the object is gravity affected, my problem is that i don't know how make the plane points toward the direction is flying.

I could make something like "every x sec/every tick rotate the plane to position ..." but like this isn't real and it's ugly to see.

I hope you can help me

• I suppose you have the forces right. Wich in my head is not that easy. You have the lift force, a vector 180 degrees on the gravity vector. And the force that make it move, vector aligned with the plane. Because they happen at the same time, you should combine both vectors in 1 force. Think my math will try and error and mostly error a while before i get that right.

The angle of the plane, on the other hand, seems easy. When its falling, it turns clockwise. When its gooing up, it turns counter clockwise. The physics expression VelocityY tells you if it goes up or down. I geuss you set the angular velocity arcording to the VelocityY. something like (-1 * VelocityY) / x. Where you have to find out what x must be to have a nice rotation.

• I suppose you have the forces right. Wich in my head is not that easy. You have the lift force, a vector 180 degrees on the gravity vector. And the force that make it move, vector aligned with the plane. Because they happen at the same time, you should combine both vectors in 1 force. Think my math will try and error and mostly error a while before i get that right.

The angle of the plane, on the other hand, seems easy. When its falling, it turns clockwise. When its gooing up, it turns counter clockwise. The physics expression VelocityY tells you if it goes up or down. I geuss you set the angular velocity arcording to the VelocityY. something like (-1 * VelocityY) / x. Where you have to find out what x must be to have a nice rotation.

Yes i'm currently using forces, i was thinking about using the bullet behaviour, i saw that the rotation is already integrated... it's possible to affect the path of a bullet like object?

• Bullet has the action 'Set angle of motion'. Effect its path = effecting the angle of motion.

Bullet also can have gravity. With the action 'Set gravity'.

I suppose you can set the gravity to something like (1/ Sprite.bullet.Speed) * (x^2), the x you have to try and error your self. (some math maniacs in here dont geuss)

Got to make an exception for when Sprite.bullet.Speed = zero, to avoid dividing by zero. So, how bigger the speed, how smaller the gravity.

Assuming that you try to fly the thing.

The rotation, i indeed think, aligns to path.

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Then again. That interface will be to difficult. You ask about physics, and i got my mind set on physics. Just forgot that a plane can be steered at full speed into the ground.

So, when the thing travels always at the same speed, a bullet would be the easy way. Just point it up to climb, or down to fall.

If you make a new project, and type 'endless' in the searchbox, there is a flyer template.

• Hey, i'd like to thank you for the support, at the end i made it. I used 2 variables to memorize x and y, then at every tick i set the angle at atan((Player.Y-yp)/(Player.X-xp)) in this way you perform a little calc on the segment between the old position and the actual position and with atan you find the angle. Math enthusiast here too.

Bye

• 7 posts