generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: The best way to script a the "throw" part of a grenade?

Previous Thread :: Next Thread 
HMKingLawrence is not online. HMKingLawrence
Joined: 08 Mar 2015
Total Posts: 293
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
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
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
HMKingLawrence is not online. HMKingLawrence
Joined: 08 Mar 2015
Total Posts: 293
10 Dec 2016 06:22 PM
What's the best way to get an arc?


Report Abuse
Xstarlight is not online. Xstarlight
Joined: 18 Oct 2012
Total Posts: 870
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
HeIIoISteaIUsernames is not online. HeIIoISteaIUsernames
Joined: 26 Oct 2012
Total Posts: 2906
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image