I’m new to developing and would like to build a game like I used to play in middle school where you would use touch input to swipe a paper wad and land it in a trash can. I am struggling with getting the wad to follow the swipe direction. I tried adding an impulse to the swipe but my “ball” never moves in the correct direction. If anyone could point me in the right direction that’d be much appreciated! Would it be possible to create a line trace based on the touch input based swipe to give the ball a path for trajectory, I know a spline won’t do because I want the ball to be affected by gravity and other physics based phenomenon. Any help would be great, sorry for the novel I just haven’t been able to find any good info on the forums…
Hey @RichTheChris1. The problem isn’t very clear in the description of your question, but for a throw simulation you basically need to have all the elements to describe the trajectory that you want. In your case I think the most important is that you have a good Input vector (from the touch input) and use that to simulate the physics.
Once you have the direction vector and its module (for the force amount) then you should be able to simulate physics and only apply an impulse to your ball. If your ball isn’t moving as expected it is likely that you are not getting the input correctly, or maybe your ball isn’t simulating physics, or maybe your gravity/weight parameters are too big or too small.
If you give more details of your problem you could get more precise answers. Like showing your current setup, showing what values are you getting from the player input, etc.
Hope this helps
I hope that screenshot helped clarify my problem in some way. I can swipe and an impulse is given to the ball however the impulse never sends the ball in the direction of my swipe. I already know this isn’t the way to go about this, like I said I’m new at developing in general but would really appreciate some help. I would just like to be able to swipe over the ball (touch input) and have the ball shot in that direction with the balls flight path being similar or the same as the swipe pattern.
