I can use PhysicsSimulate fine to modify an object's velocity, but I do not want this effect added ontop of the default physics. This is why MOVETYPE_CUSTOM exists. The problem is that when I use movetype_custom, nothing I do makes my entity move. The physics object is indeed woken, and the motion controller is started; the only difference is the use of movetype_custom.
[lua]
function ENT:PhysicsSimulate(phys,deltatime)
local angforce,linforce = Vector(0,0,0),Vector(0,0,0)
linforce = self:GetAngles():Forward()*1000
return angforce,linforce,SIM_GLOBAL_FORCE --i've also tried SIM_LOCAL_FORCE and both variations of _ACCELERATION
end
[/lua]
I've googled to see how other people used physicssimulate and came across [url=http://facepunch.com/showthread.php?t=890114]this thread[/url]. I tried his code as well, and my entity does not move any, so please be sure to test any old code you have to see if it still works.
Is PhysicsSimulate with MOVETYPE_CUSTOM (and no usage of shadow control) broken, or is there something new I need to be doing to make it work?
thread drowning
Anyone?
Sorry to necrobump a 5 year old thread but I'm having the exact same issue so there's not much point creating a new thread just to rephrase this one.
Does anyone know what the problem is here?
As stated in the OP, PhysicsSimualate() works perfectly fine to add velocity to a MOVETYPE_VPHYSICS entity, but when the movetype is changed to MOVETYPE_CUSTOM the ent just freezes in mid air.
I've inserted print statements and PhysicsSimualate() is being called just fine.
PhysicsSimulate's force is not actually applied when the movetype does not simulate the entity. You'll have to ignore the returns and move the physics object and entity position yourself. See also Add PhysicsSimulate callback/hook · Issue #1196 · Facepunch/garr..
Sorry, you need to Log In to post a reply to this thread.