|
FAQ
• Search • Login
|
|
Page 1 of 1
|
[ 7 posts ] |
|
Author |
Message |
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Colliding
Is there any way to use colliding in an if statement, like "if the particle collides with something" rather than using a distance to simluate it?
|
Wed Jul 15, 2009 12:43 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Colliding
CastMOs.
|
Wed Jul 15, 2009 1:06 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Colliding
Or use box-based hitboxes, but they're for obvious reasons less precise.
Kyred was doing something with boundingboxes, those would work better if you could do a within boundingbox check.
|
Wed Jul 15, 2009 2:30 am |
|
|
piipu
Joined: Mon Jun 30, 2008 9:13 pm Posts: 499 Location: Finland
|
Re: Colliding
Code: i = SceneMan:CastMORay(self.Pos,self.Vel,0,0,false,5) self.thingie = MovableMan:GetMOFromID(i) if self.thingie ~= nil then --stuff end Is what you're after. The collided object can be accessed with self.thingie if something was collided.
|
Wed Jul 15, 2009 9:42 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Colliding
Get the root MO, btw. So it'e more like: Code: i = SceneMan:CastMORay(self.Pos,self.Vel,0,0,false,5) if i ~= 255 then self.thingie = MovableMan:GetMOFromID(MovableMan:GetMOFromID(i).RootID) --stuff end
|
Wed Jul 15, 2009 8:07 pm |
|
|
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Colliding
Can you do "if it collides with an actor"?
|
Wed Jul 15, 2009 8:18 pm |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Colliding
Code: if self.thinge:IsActor() then .. end Done. Works even if it doesn't hit the torso.
|
Wed Jul 15, 2009 8:33 pm |
|
|
|
|
Page 1 of 1
|
[ 7 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
|
|