Projectile Sticking in Target

0 favourites
  • 3 posts
From the Asset Store
Aim carefully a shoot the ball at the target to earn scores!
  • 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?

  • Give the bolt the pin behavior. When the bolt hits the wall, pin it to the wall for position and direction.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Awesome, thank you!

    Works perfectly.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)