I made a car and i want to print when the car is in the air. I tried making it so when it touches a part, it prints that it touches and if it stops touching, it also prints something but that's not a good way. anybody know a better way? thanks
You can use raycasting, try this:
local Car = script.Parent -- Put this script in the car model. local PrimaryPart = Car.PrimaryPart -- Set a primarypart of the car. local Minimum = 10 -- Minimum height to register when the car is in the air. while wait() do local Position = PrimaryPart.CFrame.P local Rotation = PrimaryPart.CFrame - Position local Ray = Ray.new(Position,Position - Vector3.new(0,Minimum,0)) -- Ray casted down. local Touch, TouchPosition = workspace:FindPartOnRay(ray, Car) -- Ignore car. if Touch then print("Touching "..Touch.Name.. " at "..TouchPosition) else print("In air") end end