• PhysicsSimulation help in an SENT...
    3 replies, posted
Well I use this code for my sent it spawns fine and it prints the message "lolol" to the console but no effect on the ent what so ever. The only file, shared. [lua] ENT.Type = "anim" ENT.Base = "base_gmodentity" ENT.PrintName = "" ENT.Author = "" ENT.Contact = "" ENT.Purpose = "" ENT.Instructions = "" ENT.Spawnable = true ENT.AdminSpawnable = false function ENT:SpawnFunction(ply,tr) local ent = ents.Create("com_hovertest") ent:SetPos(tr.HitPos + tr.HitNormal * 50) ent:Spawn() undo.Create("HoverTest") undo.AddEntity(ent) undo.SetPlayer(ply) undo.Finish() end function ENT:Initialize() if SERVER then self:SetModel("models/props_junk/watermelon01.mdl") self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_VPHYSICS) self:SetSolid(SOLID_VPHYSICS) local phys = self.Entity:GetPhysicsObject() if (phys:IsValid()) then phys:Wake() end self:StartMotionController() end end if SERVER then function ENT:PhysicsSimulate(phy,deltatime) local tr = util.QuickTrace(self:GetPos(),Vector(0,0,-50),self) if tr.Hit then print("lolol") return Vector(0,0,0),Vector(0,0,100),SIM_LOCAL_FORCE end return SIM_NOTHING end end [/lua]
Soo... no-one interested? Too tough? Come on!
The first two return values are vectors, not angles.
Ok I will try that. [editline]03:22PM[/editline] I use what is in the OP now... still no luck. [editline]03:26PM[/editline] Ok got it working with really high amounts, and SIM_GLOBAL_FORCE
Sorry, you need to Log In to post a reply to this thread.