Jump to content

Character controller issue


ArBuZ
 Share

Recommended Posts

Hi!

I want to make controller to move to some point. PointEntity doesn't work with controller. But UpdateController() has angle parameter. So how can I calculate angle parameter?

Thanks in advance.

Best regards, Alex.

Q6600@2.4GHz - 9600GT - 4GB DDR2@800MHz - Windows7 x64

3ds max / photoshop CS3 / C++

http://www.arbuznikov.com

Link to comment
Share on other sites

Hi,

 

I use this to point an entity to another:

 

void SlowPointEnt(TEntity ent1,TEntity ent2,float speed)
{
TVec3 ent1pos=EntityPosition(ent1);
TVec3 ent1rot=EntityRotation(ent1,0);
TVec3 ent2pos=EntityPosition(ent2);
float dx=0.0;
float dy=0.0;
float dz=0.0;
float rz=0.0;
//float speed=1.0;
dx=ent1pos.X-ent2pos.X; 
dy=ent1pos.Y-ent2pos.Y; 
dz=ent1pos.Z-ent2pos.Z;
rz=ent1rot.Z;
return AlignToVector(ent1,Vec3(dx,rz,dz),3,speed);
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...