Using PhysicsSimulate with MOVETYPE_NOCLIP

I’m trying to get a scripted entity to use the PhysicsSimulate hook, but I’m having no luck.

Here’s a snippet of my code:

[lua]if SERVER then AddCSLuaFile(“shared.lua”) end

ENT.Type = “anim”
ENT.Base = “base_anim”

if SERVER then
function ENT:Initialize()

    self:PhysicsInit(SOLID_NONE)
    self:SetMoveType(MOVETYPE_NOCLIP)
    self:SetSolid(SOLID_NONE)


    local phys = self:GetPhysicsObject()
    if phys:IsValid() then
        print("hi")
        phys:Wake()
    else
        print("aw")
    end


    self:StartMotionController()
end

function ENT:PhysicsSimulate(phys, delta)
    print("ho")
    return SIM_NOTHING
end

end[/lua]

The only thing that gets printed is “aw”, so the physics object isn’t valid and PhysicsSimulate isn’t being called.

Is there anything I can try?

Didnt the movetype need to be MOVETYPE_CUSTOM?

It calls fine with MOVETYPE_NOCLIP, the PhysicsInit can’t be none or it wont be a valid physics object. Therefore Wake will be useless.

Try setting it to custom.

MOVETYPE_VPHYSICS is probably the only time your physics is going to be simulated. Like the name implies.

I’ve tried MOVETYPE_CUSTOM and MOVETYPE_VPHYSICS for SetMoveType, and tried SOLID_VPHYSICS and SOLID_CUSTOM for PhysicsInit. Does anyone know what exactly decides if an entity will have a physics object?