I have a SENT that needs to turn and face a point (like the player). This should be a smooth rotation that occurs over time; the entity shouldn't snap to face the target instantly.
I tried using [i]self.Entity:SetAngles(targetAngle)[/i] with gradual increments derived by using [i]math.ApproachAngle[/i], but the rotation is too choppy.
I've heard that I can get smoother rotation by modifying the angular velocity of the entity's physics object. The thing about that, though, is that my entity is actually a flying entity. It's basically going to be something that flies around following the player. So, I've set its move type to [i]MOVETYPE_FLY[/i], which means I can't do anything to the entity's physics object.
[b]Edit[/b]
Never mind. I found I could use [b][url=http://wiki.garrysmod.com/?title=PhysObj.ComputeShadowControl]PhysObj.ComputeShadowControl [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] inside of [b][url=wiki.garrysmod.com/?title=ENT.PhysicsSimulate]ENT.PhysicsSimulate [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]. I'd set my entity's movetype to [i]MOVETYPE_VPHYSICS[/i], but since I'm overriding the physics I can still make my entity fly.
Sorry, you need to Log In to post a reply to this thread.