Entity Movement (Not Velocity)

How can I make an entity move, say along a path from one vector to another? I know about SetVelocity() but that’s just throwing it in one direction or another instead of actually being on a set path like some sort of train.

Try and look at this library: http://wiki.garrysmod.com/?title=Constraint

From the constraint.Pulley page:

[lua]
function somerandompulleytest()
local ent1 = ents.Create(“prop_physics”)
ent1:SetModel(“models/Combine_Helicopter/helicopter_bomb01.mdl”)
ent1:SetPos(Vector(0,0,20))
ent1:Spawn()
ent1:Activate()

local ent2 = ents.Create("prop_physics")
	ent2:SetModel("models/Combine_Helicopter/helicopter_bomb01.mdl")
	ent2:SetPos(Vector(30,0,50))
	ent2:Spawn()
	ent2:Activate()


constraint.Pulley(ent1,ent2,0,0,Vector(0,0,5),Vector(0,0,5),Vector(0,0,100),Vector(30,0,100),0,0,5,"cable/cable")

end
hook.Add( “InitPostEntity”, “somerandompulleytest”, somerandompulleytest )
[/lua]

I believe you could try and figure something out.

You could use math.Approach with SetPos

Setting ENT:SetMovetype(MOVETYPE_FLY) would make the SetVelocity() more efficient, but it depends on what you’re using it for.

Is that efficient though?

[editline]24th January 2012[/editline]

I’m using this to make a quite literately ‘ban train’ which will freeze the player, slowly creep up-to them, weld the player onto the side and fly off into banid