|
| 10 Dec 2016 06:11 PM |
I'm attempting to script a grenade, and I got the explosion part down, but I'm having difficulty figuring out how to make a "smooth throw".
I could just make it teleport to where I click, but I want a nice transition.
I've never used BodyVelocity, RocketPulpusion, etc.. And I haven't really explored this area of scripting so it's rather new to me..
Can someone explain a good method and the steps to achieve it?
|
|
|
| Report Abuse |
|
|
|
| 10 Dec 2016 06:20 PM |
BodyPosition is the most simple and straight forward of them all, although it wont give you an "arc" it will make the movement smooth. Steps: 1. Make BodyPosition and insert it into your "grenade" 2. Code something similar to this:
--when the player clicks function onClick(player, pos) bodyposition.P = pos repeat wait() until --(keeps getting censored, just wait until the parts position is equal to position) end
3. tweek force and dampening (Force, D) 4. Debug 5. Eat cookies 6. Test this game: https://www.roblox.com/games/462902053/Infinita-Arcanum |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2016 06:22 PM |
What's the best way to get an arc?
|
|
|
| Report Abuse |
|
|
|
| 10 Dec 2016 06:25 PM |
Incorporate gravity into your "equation". Meaning you will have to use BodyForce which i have no idea how to use. Or you can just make a part a slight over the middle of the trajectory and then once it hits that part it goes to the mouse.Hit position and it destroys the part. |
|
|
| Report Abuse |
|
|
|
| 10 Dec 2016 06:29 PM |
i was about to say make an animation and then do the explosion thing, but i realized its complicated
i steal usernames |
|
|
| Report Abuse |
|
|