Characters on moving platforms

Mavab

20-08-2007 18:04:24

Hi,

I'm working on a project that has a character walking on a moving platform. As the platform moves I want the character to move with it appropriately.

The character class doesn't seem to do this by default, is it best that I change to a capsule with frozen rotation or is there another workaround for this kind of thing?

Thanks!

betajaen

20-08-2007 18:17:33

A Character wouldn't move with the platform because it hovers above it.

A capsule actor would work, but then you loose all the functionailty gained with the character (stair handling, rough terrain) and loose accuracy when moving around.

Once I've implemented CharacterTriggers you should be able to move with the platform, but for now. You could have a secondary actor such as the capsule to help the Character along on things such as the moving platform.

Mavab

20-08-2007 18:41:25

You must hold the record for the fastest person to ever reply on a forum :lol:

Cool, will try to implement that.

For the raycasting, how do you use RayCastReport to get all the actors that the ray has intersected in?

Thanks :D

betajaen

20-08-2007 19:19:45

Oh, I've done replied a lot quicker than that, I've achieved less than a minute several times. Sadly the forum software doesn't post to the second, so we'll never know how quick I am. ;)

The RayCastReport is a container full of RaycastHits. With all NxOgre containers you can iterate through:

for (RayCastHit* hit = mRayCastReport.begin();hit = mRayCastReport.next();) {
Actor* actor = hit->mActor;
...
}