Can someone please tell me why this is returning nil.
the part on ray returns nil for some reason even though it should be htting the players character
solution:
you really dont need the 750 but just to make sure it goes through the player i put that
OverHash
(OverHash)
January 26, 2019, 9:03pm
2
Rays are constructed with two arguments, the Origin (where to start the ray from) and a direction, you are trying to use the direction property as an endpoint, which won’t work.
2 Likes
Did you make sure that the if statement isn’t passing? You have it set to return nil there if it passes.
I really don’t get what you mean. Isn’t the second argument where you want it to point to
I got what you meant thanks
It’s the direction of the ray, away from the first position argument.
1 Like
yelowfat
(yeIIow)
January 26, 2019, 9:11pm
8
Your direction argument says
HumanoidRootPart.Position * 10
you cannot mutiply vector3’s by a number value for the purpose of finding a direction; it just wont work like that
so instead do this
HumanoidRootPart.CFrame.LookVector * 10 --this will take the forward facing vector of the part's cframe and go 10 studs along it
this should fix your issues
Vulkarin
(Vulkarin)
January 26, 2019, 9:21pm
9
You can multiply a Vector3 by a number value
Even though the question was already answered, can you post the solution so that others can see?
yelowfat
(yeIIow)
January 26, 2019, 9:23pm
10
Thanks for the clarification, I made an edit
1 Like
yelowfat
(yeIIow)
January 26, 2019, 9:29pm
12
the original statement was a bit vague, I clarified.
1 Like