What do you want to achieve? Keep it simple and clear!
On VehicleSeat Going Fast, Print A Statement.
What is the issue? Include screenshots / videos if possible!
Wont detect the car is moving fast, and is only printing “not fast”
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Devfourms and videos
Code:
local hitPart = script.Parent
local vehicleSeat = script.Parent.Parent.VehicleSeat
local speed = vehicleSeat.CFrame.LookVector:Dot(vehicleSeat.Velocity)
while true do
task.wait(0.5)
if speed >= 15 then
warn("going fast")
else
warn("not fast")
end
end
I believe in your case speed is just a number variable. When you call speed = vehicleSeat.CFrame.LookVector:Dot(vehicleSeat.Velocity) it sets your variable speed to the vector dot product at the time of you calling it, so if this script runs as soon as the game starts speed would be 0.
Instead try changing if speed >= 15 then to if vehicleSeat.CFrame.LookVector:Dot(vehicleSeat.Velocity) >= 15 and see if that works