How do I have a character throw an object in an arc?

0 favourites
  • 10 posts
From the Asset Store
Throw daggers and hit the most fruit! Watch out for the wind, if you run out of daggers you'll lose the game!
  • I have a character that picks up and throws objects left and right in an arc or straight up. Right now the throwing is a little wonky. I'm using a platform behavior that toggles on and off with instance variables, but it doesn't work the best. Is sine behavior better, and if so how? Or is there a really simple solution that I'm missing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use simple Bullet behavior with gravity.

  • Ah, okay. Is there a way to check if the bullet is on a floor to stop? Just so It doesn't stick to walls or ceilings? Or should I just pin a sprite underneath as a trigger to stop?

  • If you only have one floors. On collision with “floor” dis-enable bullet.

    You can do this for multiple floors but the more you have the more spaghetti it becomes

  • I have a couple different floor sprites, but just making a family would work, I think.

  • I was playing around with bullet with bounce and I made a pretty decent as well as easily implementable system.

    If you are still looking to set yours up take a look:

    youtu.be/CX_Use-Zi-o

  • Cool, I'll check it out. Thanks!

  • The video mostly worked! The only issue on the throwing with the set bullet angle of motion seems to undo the gravity completely and just sends it in the directed angle. If I don't do that it works, but only to the left it seems. If I use negative bullet speed to invert it, it just bugs out completely. I think because of how it divides speed maybe.

  • You definitely want to keep the bullet speed positive.

    I did have to set both the 'thrown items' angle as well as bullet angle for the direction to take effect (Which I found weird). But none of that should effect your gravity.

    Do you maybe have a max speed set that has the bullet continue to gain speed? Or do you reset your bullet speed after it's in the air. Those might overpower the gravity and make it seem like it's not working

  • Ah, okay. I noticed in debug the speed isn't decreasing either. I think it has to do with my instance variables maybe. Because my setup isn't exactly the same, but I'll check that out.

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