Argument
variable is mouse
local Arrow=Instance.new'Part' Arrow.Size=Vector3.new(.1,.1,1) Arrow.CanCollide=false Arrow.BrickColor=BrickColor.new'Brown' Arrow.CFrame=Player.Character.HumanoidRootPart.CFrame+Argument.Origin.lookVector local BodyForce=Instance.new'BodyVelocity' BodyForce.Velocity=Argument.Origin.lookVector*50 -- this is probably what needs to be changed BodyForce.Parent=Arrow Arrow.Parent=workspace
I think the problem is that the arrow is heading to the mouse position that is very far away. What I mean is that it ignores the parts that are closer to the mouse... Let me just give you an example:
---- = arrow trail
[] = part
o = Position the arrow is heading
How it is currently:
----------------[]-------------o
How I want it to be:
--------------o[]
In-game:
https://gyazo.com/a1ec1fe268fe72e0322f0e697e2c2bc2
I would appreciate any help, thanks.
@Nogalo
This works better but is this the right way of using raycasting? I'm new to it...
local ray=Ray.new(Player.Character.RightLowerArm.CFrame.p,(Argument.Hit.p-Player.Character.RightLowerArm.CFrame.p).unit*500) local ignore=Player.Character local hit,position,normal=workspace:FindPartOnRay(ray,ignore) local Arrow=Instance.new'Part' Arrow.Size=Vector3.new(.1,.1,1) Arrow.CanCollide=false Arrow.BrickColor=BrickColor.new'Brown' Arrow.CFrame=Player.Character.HumanoidRootPart.CFrame+Argument.Origin.lookVector local BodyForce=Instance.new'BodyVelocity' BodyForce.Velocity=(position-Arrow.Position)*2 BodyForce.Parent=Arrow Arrow.Parent=workspace