How do I retrieve angle from a obj controlled by physics

Get help using Construct 2

Post » Thu Nov 12, 2015 10:29 pm

Is it possible to retrieve angle of an object that is controlled via physics?
I'm moving it by:
Image

But when this object collides with another physics object I can't rotate it towards direction that it's really moving after collision.
Is it possible?
B
55
S
14
G
10
Posts: 287
Reputation: 7,677

Post » Fri Nov 13, 2015 9:23 am

Using object.physics.velocityX and object.physics.velocityY you can get the pixels per second the object is moving in horizontal and vertical direction..

Without having to use math

angle(object.x,object.y,object.x+object,physics.velocityx,object.y+object.physics.velocityy) should get you the current angle of movement..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: David181 and 14 guests