Need some input here on how to resolve a problem that only happens when the ent being followed starts moving fast backwards. The FOLLOW_ENT , being noclip, will collide with the ent, and occupies the same origin as the ent its following. This is the code:
Code: Select all
self.movetype = MOVETYPE_FOLLOW;
makevectors (e.v_angle);
self.aiment = e;
self.punchangle = e.angles;
self.view_ofs = ((v_forward * -13));
if (!infront (e)) // tried this, not working
self.view_ofs = ((v_forward * 13));
self.nextthink = time + sys_ticrate;
Basicly v_forward reverses direction when the ent (e) starts moving backwards. At low velocity, its ok, but once you hit near sv_maxspeed, it starts to wander into (e) eventually. Network play makes it worse. I suppose I could do constant tracelines or traceboxes to detect collision, as a .touch is not wise here....but how to code so it smoothly sets origin, and not is jerky?