Author Topic: Client-side ContainerRayCast  (Read 1392 times)

Code: [Select]
%start = %player.getEyePoint();
%end = VectorAdd(VectorScale(VectorNormalize(%player.getEyeVector()), 10), %start);
%brick = FirstWord(ContainerRayCast(%start, %end, $TypeMasks::FxBrickObjectType, %player));
I'm not really sure why this isn't working but I think it has something to do with it being client sided. %player contains the client-sided player object. For some reason %brick always ends up being 0.

In DumpConsoleFunctions(); a note given for the Raycast functions is that they only work server side.

Could I use a projectile to simulate it? Or would that not work client-side?

Creating projectiles *might* work clientside. You can't get the names of datablocks of things, though. (you'll get a number not wrenchItem, brick2x2data, etc, the names aren't transferred)

Try it and see.

Torque documentation that I've seen has said containerraycast is server-side only. Although if someone knows that it can be used client-side, post away.