there is no orientation property of rays (i think) how could i do it in a diffrent way something like this
I recommend raycasts, but to send a ray in the direction of a part just use
Part.CFrame.LookVector * 10000
10000 being the range of the ray
also how can i make a part that highlighs the direction of the ray
the rayOrigin
line errors because you can’t create a Vector3 using a CFrame because the Vector3.new()
constructor expects 3 parameters being the x-y-z components which are numbers and not Vector3
s or any other
rather you can get the Vector3 position of a CFrame using
CFrame.Position
so the code should be
local rayOrigin = workspace.Part.Position -- this is the same as workspace.Part.CFrame.Position
local rayDirection = workspace.Part.CFrame.LookVector * 100
local raycastResult = workspace:Raycast(rayOrigin, rayDirection)
thanks but i already fixed it when you were writing this but still thanks for helping me! :>
then what did you do to fix it, I’m curious
i dont rember the code is messy sorry i havent used raycasts before
how about screnshotting the script again
also im new at using devforum this is my 2nd post
you can still move the post to #help-and-feedback:scripting-support and next time if you need help with a script post it in #help-and-feedback:scripting-support and not on #development-discussion
oh. sorry as i said before this is my second post
the rayOrigin
line is the same as my solution, i guess that technically means i kinda solved it lol
i understand, i hope you learned from your mistake and i believe you can still move this post to #help-and-feedback:scripting-support
how can i do that?
doneeeeeeeee
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.