I’d like to make a part spawn from where the player’s mouse is at, then make raise up, and then I want the part to be thrown to where their mouse location is at. How do I go about setting it up so the throwing effect happens?
This is the script and local scripts ocmbined into one pastebin
2 Likes
Hello,
What you can do is use raycast and when player touches the part, you can tween the parts height to adding 5 studs, then increase lookvector to get the throwing mechanic
1 Like
Scripting support is for if you have an existing script (no, I’ve got no clue where it should go.)
1 Like
If you’re interested in the physics side of that, here is a great tutorial:
This guide was originally written for scriptinghelpers . The original can be found here .
As a somewhat active member of the Scripting Helpers discord one of the most common questions I see is how to have a projectile travel an arc. Most people want to know how to do this for things like basketballs or cannon balls and so forth. Since this is such a popular question I thought it would be worth writing a blog post on it and talking about a few other things we can extend from our findings.
Deri…
I’d recommend a body position to move the part upwards. Then you can use the physics from the tutorial above to set the velocity correctly.
2 Likes
I do have the actual script, my bad let me edit it and put it into a pastebin
1 Like
You could just paste the script into this with ``` on top and bottum.
1 Like
I already made it into a pastebin
1 Like
Requires a bodymover Velocity maybe
local x = game.Players:WaitForChild("LocalPlayer")
local char = x.Character
char.Head.Position.X,char.Head.Position.Y + 2,char.Head.Position.Z
2 Likes
Thank you, This led to me figuring out I could use the mouse.Hit.p in an equation with the BodyVelocity to send it towards my mouse location
1 Like