I am trying to make my ent bounce when colliding with something, i have tried different ways what i got atm is.
[lua]function ENT:PhysicsCollide(data,physobj)
vel = physobj:GetVelocity()
newvel = vel:Normalize() * -1
physobj:ApplyForceCenter( newvel )
end[/lua]
But it is just not bouncing, or when i change the number multiplying vel:Normalize() it spazzes out on the floor moving left and right very fast.
I have tried using garrys method but it just makes it bounce to the left then roll along the floor
Thanks
[lua]function ENT:PhysicsCollide(data, physobj)
local vel = data.OurOldVelocity
local norm = data.HitNormal
local ang = vel:Angle()
ang:RotateAroundAxis(norm, 180)
local newvel = ang:Forward()*-1*vel:Length()
physobj:SetVelocity(newvel)
end[/lua]
Something like that.
[QUOTE=MakeR;21796637][lua]function ENT:PhysicsCollide(data, physobj)
local vel = data.OurOldVelocity
local norm = data.HitNormal
local ang = vel:Angle()
ang:RotateAroundAxis(norm, 180)
local newvel = ang:Forward()*-1*vel:Length()
physobj:SetVelocity(newvel)
end[/lua]
Something like that.[/QUOTE]
Yee Know Tooooo Much
Did it work then?
ye and u reply too fast :P
I replied in 9 minutes, that isn't fast :v:
i mean the replies to these replies
[editline]08:10PM[/editline]
xD
I'm seeing double :(.
haha although one is more special than the other in more ways than one ^^
[QUOTE=WhiTAkeR;21797063]haha although one is more special than the other in more ways than one ^^[/QUOTE]
That made you sound really gay. I'm rating you gaybow.
[editline]08:25PM[/editline]
Enjoy it.
the only one who enjoys gayboys o sorry gaybows is you ! :)
Sorry, you need to Log In to post a reply to this thread.