View unanswered posts | View active topics It is currently Thu Dec 26, 2024 4:22 pm



Reply to topic  [ 2 posts ] 
 CastMORay: attempt to index Ray failed? 
Author Message
User avatar

Joined: Mon Apr 05, 2010 8:04 am
Posts: 149
Location: Under your bed
Reply with quote
Post CastMORay: attempt to index Ray failed?
Mmk, so I'm making a slightly clunky weapon to try my hand at some of this attachable scripting. I've got almost everything finished, but also being my first attempt at casting a MORay, I seem to have encountered a problem.
Code:
      if not self.Parent.HFlipped then
         self.XVect = Vector(100, 0);
         self.Ray = SceneMan:CastMORay(self.Pos,self.XVect,0,0,true,2);
         if self.Ray:IsOfActor() and self.Ray ~= 255 then --error occurs here
            self.Target = self.Ray:GetRootMOID();
            if self.Target.Team ~= self.Team and self.Ray ~= 255 then
               hit.Pos = self.Target.Pos;
               MovableMan:AddParticle(hit);
            end
         end

This is the problem code. An error occurs at the line with the comment. "Attempt to index field 'Ray''" Any insight?


Wed Jan 25, 2012 3:05 am
Profile YIM
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: CastMORay: attempt to index Ray failed?
Code:
MovableMan:IsOfActor(self.Ray)


instead of

Code:
self.Ray:IsOfActor()


Same thing with your

Code:
self.Ray:GetRootMOID()


Wed Jan 25, 2012 3:09 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.038s | 15 Queries | GZIP : Off ]