Page 1 of 1

Collider Problems

PostPosted: Wed Nov 09, 2011 3:42 am
by wodan944
Hi, I got this weird problem.
I made a rotated door animation and I gave it a Terrain Component, at this moment no problems.
Then I made a SDL and a Python file, because this door should be open after a few button sequence.
Now the door suddenly has no terrain and you can walk right thru it.
I gave it a new terrain and the door appears very small when i visited it in the game, and with no terrain it has its normal size.
Then I tried to make a proxy terrain box, attached with Link to the door, but the same problem appears, the box is now small and it blocks not completely the door, but just a small part.
Does anybody experienced this same problem and maybe solved it?

Wodan944

Re: Collider Problems

PostPosted: Wed Nov 09, 2011 4:32 am
by andylegate
I've never experienced my door changing sizes when applying physics to it or animation, only failure of the door to work correctly. You could try using Reset XRef in the Component Utilities and also reseting the scaling and transform on it.

When it comes to doors, you really should be using Exclusion Regions to block players from passing through it when it is closed. It does more than that, it will also move players out of the way if they are inside the region, so that we don't see the door cutting the player in half, or swinging through them when opening and closing. Here is a tutorial on how to set up Exclusion Regions:

Exclusion Regions Tutorial

Or the mirror at:

Exclusion Regions

Re: Collider Problems

PostPosted: Wed Nov 09, 2011 6:34 am
by wodan944
@Andy, the problem is that see this small size when you are in the game, in Max however all looks fine.

Here is what I did before the problem appeared:
I animated a Dummy and used Link to attach the Door mesh to it. when I made this the door still had collision.
A friend of mine needed my Max file for building the SDL and Python to it and made some Lever Sequences. When we were in contact, he said that the
animation looked weird for him after a few tries, not opening well or swings in the wrong direction etc and then we watched it with a few other people online.
This weird looking animation was also visible for some of us still with the SDL and Python files installed!
So he deleted the Dummy and animated the door directly and now everything looks fine in game, no weird looking animations but without collision.
Is this problem coming from animating the door mesh instead of animating a Dummy?

I will give it a try with the Xref component, the exlusion region will be added when I build my footstep and swim region at the end, when my Age is completed.

@Andy: Thank you for your answer :)

Wodan944

Re: Collider Problems

PostPosted: Wed Nov 09, 2011 11:33 am
by andylegate
Without seeing the file, I can only give you things to look at and check out.

For animations, select the object that is animated, then click on the Motion tab to the right (it has a little wheel for an icon). Make sure the controllers for Position is set to "Position XYZ" and that Rotation is set to Euler XYZ. This is normally the default controller, but it is possible to change it. Whatever you do, try not to EVER use TCB controller! It will take short cuts with your animation (like you rotate an object 270 degrees clockwise, it will instead rotate it 90 degrees counter clockwise) and the only way to make it work is to force the issue by making a key marker every few degrees.

Check your Dope Sheet for your animation and make sure you have the note track set correctly (using the @start and @end commands)

Check how you are exicuiting the animation. Remember that you need to either Set Forward or Set Backwards prior to playing the animation.

Physics and Animated objects are like trying to mix oil and water when it comes to Plasma. The general rule is: Animated objects will not have collision with the player. You can tell Plasma to that it can move objects (one of the options in the roll out), but that will not give you proper collision for players. In fact, they'll not have any collision. Animating a Dummy and then linking an object to it, will work, but again, the physics will not work correctly.

There are 2 ways to do doors that are normally used. The main one is using Exclusion Regions as I suggested in my above post (this is because Exclusion Regions help make the doors Multiplayer friendly too).
The 2nd way you an do it, is to put in a invisible collider that is NOT animated. It instead sits there and blocks the player while the door is closed.
Then when the player opens the door, in the responder for doing that, you can use the Disable Physical command on that invisible collider, and it will be turned "off" so that the player can walk through.

I don't like to use the 2nd way, as when I was helping build Mars Colony, we found out that MOUL's PhysX tends to be very flaky with that method (and one of the reason you'll find just about all doors in MOUL use the Exclusion Regions). Sometimes the door physics would work, sometimes not, sometimes the player would get stuck.

Re: Collider Problems

PostPosted: Wed Nov 09, 2011 2:57 pm
by Tsar Hoikas
The correct way to build a door is using exclude regions. You'll want to parent an invisible collider to your animated object. It will move with the animation but not be animated itself ;)

This is based off my PRP knowledge, not based on any kind of age building experience BTW.