Open Mat40 opened 2 years ago
Have you tried SetVelocityInstantaneous?
yes
try ent:GetPhysicsObject():SetVelocity() and SetAngleVelocity too
i have already try this but not working i have conclude that when can reset an entity velocity, it’s very strange i have ask on some big discord communautary and nobody understands why it’s not working
hi buddy! i think i may of found a fix for you lmk if its works!
ent:SetVelocity(stopVector)
change this line to these three lines, because setting a velocity of 0 apparently just adds 0 to the velocity, causing no change
local stopVector = ent:GetVelocity()
stopVector:Negate()
ent:SetVelocity(stopVector)
(also delete your declaration for stopVector at the top of your code)
okk thx i will try this
Quote from Entity:SetVelocity - Garry's Mod Wiki
WARNING If applied to a player, this will actually ADD velocity, not set it.
I guess this might be related.
Hello I noticed that when we setVelocity an entity we can not reset it. Indeed, my print(ent:GetVelocity()) output -1227 in x while I SetVelocity to 0 just before