How do I stop an object from rotating after it pins?

Get help using Construct 2

Post » Wed May 20, 2015 6:52 pm

I currently have a bullet that pins to objects as a "splash" effect after it hits. Like paintball.
I use on touch, set angle to touch.x and touch.y

However when the bullet hits the object, it continues to rotate a little bit once it hits.

Is there a more efficient way to have my bullet go in the direction I touch, or how can I stop it from rotating once it hits?
Thanks!
B
5
Posts: 37
Reputation: 299

Post » Wed May 20, 2015 7:37 pm

Use the "is pinned" condition from the pinned object.

Then on your ontouch event add the condition bullet is pinned (and invert it so it basically says bullet isn't pinned)

Now its possible I miss understood you when you said it continues to rotate a little bit once it hits.
If by that you mean you had your bullet rotate a set amount of degrees per tick towards touch.x and touch.y
then you'll have to add an event on collision that instantly finishes the rotation or simply stops the rotation.
Depends on what you're using to rotate the object (the sprite angle, the bullet behavior angle, ect.).
B
4
Posts: 9
Reputation: 220

Post » Wed May 20, 2015 7:51 pm

Thank you! What event / action would I use on collision to finish / stop the rotation?
B
5
Posts: 37
Reputation: 299


Return to How do I....?

Who is online

Users browsing this forum: blue visionary, OBLIVION and 12 guests