how do i make an entity in entities move to a vector back and forth in a loop Example Vec = { Vector(1000,0,0), Vector(2000,0,0) }
[QUOTE=raven119;19477923]how do i make an entity in entities move to a vector back and forth in a loop Example Vec = { Vector(1000,0,0), Vector(2000,0,0) }[/QUOTE]
It's easiest if you've got a specially made entity to do it. One way of getting it to move between those positions is to change its position every time the entity does a think, like this:
[lua]
function ENT:Think()
self:SetPos( Vector( (CurTime()%1000)+1000, 0, 0 ) )
end
[/lua]
A more complex solution would probably require using the PhysicsSimulate hook with the ComputeShadowControl function, but that's beyond the scope of Newbie Questions most of the time.
Sorry, you need to Log In to post a reply to this thread.