Hello.
I'm currently trying to make a Raycast detect when an object / part is in the air. My game involves the user being able to place down notes wherever they want if allowed.
Now, there is a way to exploit this by placing the notes on the air, and to combat this I thought using a raycast on the server to check if the part is in the air would be the best solution.
So essentially, my goal is to get a ray to be casted from behind the note so it would hit either a wall, the floor or the roof.
Here's my code so far:
local RayMaximumRange = 2 local RayCastHit = workspace:Raycast(NoteClone.Note.Position, -NoteClone.Note.CFrame.LookVector * RayMaximumRange) if not (RayCastHit) then print("Is in the air ") end
I'm new to raycasts so I'm actually kind of clueless at the moment.
If I could get some help with this, It'd be great.
Thanks
Don't put parenthesis in "RayCastHit" on
Your code should work fine now