Posted by Anonymous on Tue 16th Jan 17:42 (modification of post by Anonymous view diff)
diff | download | new post
- ENT.Type = "anim"
- ENT.PrintName = ""
- ENT.Author = ""
- ENT.Contact = ""
- ENT.Purpose = ""
- ENT.Instructions = ""
- function ENT:TrackEntity( ent )
- if ( !ent || !ent:IsValid() ) then return end
- local WPos = ent:GetPos()
- WPos.y = 0;
- WPos = WPos + Vector( 0, 0, 400 )
- if (self.Entity:GetPos() - WPos):Length() > 400 then self.Entity:SetPos(WPos) Msg("to far away!\n") end
- local v = ent:GetVelocity()
- v.y = 0
- local adjustVec = Vector(self.Entity:GetPos().x, self.Entity:GetPos().y, WPos.z)
- if (v.z == 0) then
- self.Entity:SetPos( adjustVec )
- end
- if (SERVER) then
- self.Entity:SetLocalVelocity( v )
- end
- local Ang = ent:GetPos() - WPos
- Ang = Ang:Angle()
- Ang.Pitch = 0
- self.Entity:SetAngles(Ang)
- end
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.