[SOLVED] Make a sling shot mechanic?

I want to make a sling shot mechanic like angry birds or Jump Knight where i pull the mouse in a direction and the character will be thrown to the other direction - the speed and angle depending upon how much i drag and in what opposite angle respectively. Help would he greatly appreciated.

Hope this can help you. You can watch his channel for more of the mechanic that you want to achieve in your game.

this doesn’t help much. I have seen this already. The object moves to the same direction it is dragged. I want a sling shot mechanic where the force will be to the opposite direction of the pull. In this case my character doesn’t need to rotate. it has fixed rotation hence torque will not work.

Here’s one of the physics example projects, I went to the distance joint, set one of the objects as static and set Frequency to 4.
image
Pull the other object and release.
If you delete the joint a bit after the release, you should get a nice slingshot.

1 Like

So instead of applying the force at the angle from object to the touch/mouse position, apply the force in the opposite direction (angle + 180) or apply a negative force. Then it will go in the opposite direction.

1 Like

@MrMen have tried this already. Doesn’t seem to work in the latest version of gdevelop. In the older version, the base thing works but my player has fixed rotation. Applying the same doesn’t make the player move at all.

Rubbish. This :

results in this :

SlingShot

3 Likes

I see. You have applied a for to angle position. I did what the video said - applied torque. And since my player has fixed rotation, it did not work. I will try this with my scene. Thanks

I know this was last talked about over six months ago, but I feel it necessary to say that I just divided the length by a negative integer initially to reverse the force direction. It’s been working fine for me.

3 Likes