View unanswered posts | View active topics It is currently Fri Dec 27, 2024 10:08 am



Reply to topic  [ 3 posts ] 
 SetAimAngle Question - Solved 
Author Message
User avatar

Joined: Mon Aug 17, 2009 3:00 am
Posts: 242
Location: The Great White North
Reply with quote
Post SetAimAngle Question - Solved
Sorry, but I've got a question here.
I apologize in advance if it's just a stupid syntax mistake.

This script is running on a ahuman.

Code:
function Create(self)
   self.XVARIABLE = 0;
end

function Update(self)
      self:SetAimAngle(self.XVARIABLE);
      self.XVARIABLE = self.XVARIABLE + 0.1;
end


Shouldn't this cause the actor's aim angle to continuously swing in a circle?
However, all I get is an actor locked aiming straight up.
Any ideas?


Last edited by Dr. Evil on Thu Jan 28, 2010 5:04 am, edited 1 time in total.



Thu Jan 28, 2010 4:15 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: SetAimAngle Question
If the AimAngle is beyond pi / 2, it just rounds off to pi / 2.
Here's what your script will need to do:
First, check if HFlipped is true. If it isn't, the increase the aim angle. If the aim angle is greater than math.pi / 2, set HFlipped to true.
If HFlipped IS set to true, decrease the aim angle. If the aim angle is less than negative math.pi / 2, set HFlipped to false.


Thu Jan 28, 2010 4:19 am
Profile WWW
User avatar

Joined: Mon Aug 17, 2009 3:00 am
Posts: 242
Location: The Great White North
Reply with quote
Post Re: SetAimAngle Question
Thank you so very much.


Thu Jan 28, 2010 5:03 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.041s | 13 Queries | GZIP : Off ]