About Store Forum Documentation Contact



Post Reply 
Rotating
Author Message
Ogniok Offline
Member

Post: #1
Rotating
Hi.

I have a problem with my project. I set up some tanks on map and I want every of them to aim their targets.

To set good angle I use code:

Code:
Flt angle_delta = AngleDelta(turretAngle - PI_2, Angle(targetTank().pos().xz() - pos().xz()));
Flt max_frame_delta = Time.d() * DegToRad(270);

Clamp(angle_delta, -max_frame_delta, max_frame_delta);
turretAngle += angle_delta;

but it don't work. This is what I get:

[Image: TVfO6.png]

How must I change this code so it will work fine?
12-13-2011 07:19 PM
Find all posts by this user Quote this message in a reply
Post Reply