[help/feature request] Get Normal Vector on Hitbox?

Get help using Construct 3!

Post » Fri Aug 25, 2017 1:42 pm

Image

my object is outside of the sprite.
i get the vector from the object to the nearest image point

is it possible to get the Normal vector to the hitbox?

edit:
and the hit point too?
B
6
S
2
Posts: 22
Reputation: 571

Post » Tue Sep 05, 2017 5:48 am

There was a raycast plugin in C2 that could do some of that. There was also a chipmunk physics behavior for c2 that could give that info.

For C3 I don't believe there is anything. You could put an image point on top of every collision polygon point, so you can access it from events, and then calculate everything from scratch. Or you could search for examples of how to do lasers in C2. That could give the collision point where the laser stops, and then you could guestimate the normal.

The tutorials section may also have some ideas.
B
94
S
33
G
118
Posts: 5,395
Reputation: 75,851


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 0 guests