Can I make an actor not have a collision with another actor?

Non-platform specific questions.

Can I make an actor not have a collision with another actor?

Postby ericdg » Sun Dec 11, 2005 3:33 pm

I know your thinking use collision state, well let me explain.

I have two actors that I want to collide with everything on the level, but not each other.

I can go into each actor and list all other actors I want it to collide with, and just leave out the actor that I don't want it to collide with, but that can take forever if you have 50 actors.

I can't change the collision state to disable, because it won't collide with anything else then.

I'm sure there is a code for this, but I'm new to C, and I'm not sure how.

Thanks.
ericdg
 
Posts: 53
Joined: Tue Nov 29, 2005 1:18 pm
Score: 1 Give a positive score

Postby makslane » Mon Dec 12, 2005 12:25 pm

You can create a variable, like canCollide, set the value to 1 in the actors that can collide:

canCollide = 1;

In the collision event, make the test:

if(canCollide)
{
//Your collision actions here
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron