Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Mouse.Hit.lookVector shooting objects in different locations ?

Asked by
eyad27 8
5 years ago

For some reason, the blast doesn't follow the position of the mouse. It goes in diffrent locations based on the player's rotation.

01RC.OnServerInvoke = function(player,empty,hum,car,pli,play,mouse)
02    hum.WalkSpeed = 0
03    wait()
04    empty = false
05    local block = Instance.new("Animation")
06    block.AnimationId = blockid
07    local BlockTrack = hum:LoadAnimation(block)
08    BlockTrack:Play()
09    wait(0.5)
10    local blast = Instance.new("Part")
11    blast.Parent = game.Workspace
12    blast.CanCollide = false
13    blast.BrickColor = BrickColor.new("White")
14    blast.Material = Enum.Material.Neon
15    blast.Size = Vector3.new(4,4,30)
View all 24 lines...
1```local mouse = pli:GetMouse()
2local play = mouse.Hit.lookVector * 100```

Evidence:

https://streamable.com/5gzr4r

Any suggestions/ solutions ?

0
Try Mouse.hit.P instead of mouse.hit.LookVector oilkas 364 — 5y
0
Its because, on your script line 2 the script its basically saying where the player looks face the camera up lookvector * 100 JesseSong 3916 — 5y
0
“ Try Mouse.hit.P instead of mouse.hit.LookVector” do I just write “P” or “Position” eyad27 8 — 5y
0
How do I get the mouse without referencing the player eyad27 8 — 5y
View all comments (2 more)
0
I finally managed to solve it by adding the mouse.Hit feature inside the InputBegan function and it worked. Thanks to everyone that helped eyad27 8 — 5y
0
How do I make the question answered eyad27 8 — 5y

1 answer

Log in to vote
0
Answered by
eyad27 8
5 years ago

I finally managed to solve it by adding the mouse.Hit feature inside the InputBegan function and it worked. Thanks to everyone that helped.

Ad

Answer this question