Projectile Sticking in Target

Get help using Construct 2

Post » Wed Feb 06, 2013 4:31 am

I'm working on a game that uses a giant ballista to launch bolts at a physiced fort, where the walls and such can be knocked around and destroyed.
I want the bolt to stick in when hitting such a wall, but I'm not sure how.
On a static wall I can just swap out the bolt sprite for a static one that just stays in place after a collision, but then when the wall moves or disappears the bolt will just be floating there.
I can set an image point on the wall and stick the bolt to it every tick, but then the bolt will stick to exactly the same point regardless of where it actually struck.
Is there perhaps some way I could register the position of the bolt relative to the position of the wall's Origin on a collision, then set it to that every tick?grimwolf2013-02-06 04:32:24
B
6
S
1
Posts: 67
Reputation: 986

Post » Wed Feb 06, 2013 4:50 am

Give the bolt the pin behavior. When the bolt hits the wall, pin it to the wall for position and direction.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Wed Feb 06, 2013 5:28 am

Awesome, thank you!
Works perfectly.
B
6
S
1
Posts: 67
Reputation: 986


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest