# How do I check a physics object's velocity at an angle

Get help using Construct 2

### » Thu Jul 27, 2017 2:00 pm

Hey there, I want to check if a physics object's velocity at an angle is greater than X, but in C2 I only found the option to do this only on the X or Y axis...

I know there must be some way of finding it out by using the separate X and Y velocities and applying some mathematical equation, but math was never my strong point =D
B
31
S
9
G
7
Posts: 262
Reputation: 5,671

### » Thu Jul 27, 2017 5:28 pm

You can use a dot product to get that:

cos(angle)*sprite.physics.velocityX + sin(angle)*sprite.physics.velocityY
B
95
S
33
G
128
Posts: 5,490
Reputation: 81,568

### » Thu Jul 27, 2017 10:01 pm

R0J0hound wrote:You can use a dot product to get that:

cos(angle)*sprite.physics.velocityX + sin(angle)*sprite.physics.velocityY

Awesome, thank you very much!
B
31
S
9
G
7
Posts: 262
Reputation: 5,671

Return to How do I....?

### Who is online

Users browsing this forum: No registered users and 26 guests