How to predicts entitys vector?

I’m trying to predict entity’s position(vector) after certain amount of time…
I’ve tried something like this:
trigger:


self.PosPT = CurTime()+ 0.1
self.BPos = ent:GetPos()

Think:


if CurTime() >= self.PosPT then
self.PosPted = ent:GetPos()+ (ent:GetPos()- self.BPos)* self.PosPmul
end

This isint a copy paste, this is straight from my head while writting this thread… So might not work if you try it, but you get the idea what i dried to do since it worked for me. The problem is i want it to always predict the position judging by its velocity, not by trigger. Where should i start?

–EDIT–
Yeah yeah, i know i made a mistake in the title…

You want to get the entity’s position in the future assuming it’s travelling in a straight line? You could do:
[lua]
self:GetPos()+self:GetVelocity()*secondsinfuture
[/lua]
If it’s an entity that has prop physics you might have to do this instead:
[lua]
self:GetPos()+self:GetPhysicsObject():GetVelocity()*secondsinfuture
[/lua]

I thought GetVelocity() returns a number :confused: How didnt i think of that :confused:
Anyway… Works perfectly, ty.