Player pick up and throw object

Hello, I want to be able for my character to be able to pick up the basketball and throw it in the air once you let go of the space bar, but I don’t know a lot about the coding on this platform.

So something like, if you hold space, the basketball increases initial velocity or speed, and when let go, it immediately flies in the direction the camera is facing? if so, all you gotta do is code it so that the basketball’s speed or force gets added to as long as spacebar isPressed. Make sure to check if the ball has reached it’s maximum initial force, which then means that the ball will no longer add force to the speed variable. When spacebar is let go or wasReleased, you add the speed variable to the basketball as an impulse. Oh yeah, and don’t forget to make the ball’s rigidbody type dynamic, and add collision, preferably a sphere shape, to it.

1 Like

You can add me to your project so I can help demonstrate what I mean. Add me to you project. My username is dev01.


Wow, thank you so much!