How to make a raycasting gun

No I am not using loops I am using RemoteEvents

2 Likes

It really teaches me how to use raycast!

2 Likes

Thank you so much for this tutorial, It’s a lot easier to understand than others!

1 Like

the bullet does not appear, i do not know what exactly went wrong. Theres no errors, the bullet is anchored in ServerStorage, the scripts are the same as the ones here.

1 Like

How can I make a Shotgun Raycast or an Automatic Raycast?

1 Like

Just add a raycastParams
here is the link for tutorial

1 Like


What does this mean?

local origin = shoot_part.Position

line 20 = local direction = (position - origin).Unit*300

local result = Workspace:Raycast(origin, direction, params)
1 Like

You are trying to subract(sub) on nil(nothing) and a Vector3(x,y,z)

Something doesn’t exist in your code that what nil means

1 Like

I think position is nil . What that error states is that ur trying to ‘-’ a vector3 with nil . Im quite sure the variable called position is an argument in the remote event . Please make sure that u fire the position value on the local script