Author Topic: Crosshair & Camera look angle  (Read 1045 times)

Is there a way to make the crosshair show up while the client is controlling a camera?
Also is there a way to figure out where the camera looks?

I'm not 100% sure about the crosshair thing, I'll go look, but if you want to get the position a client is looking at:

Code: [Select]
%length = 100;
%vector = vectorAdd(%cam.getEyePoint(), vectorScale(%cam.getEyeVector(), %length));
%ray = containerRayCast(%cam.getEyePoint(), %vector, $TypeMasks::All);
%position = getWords(%ray,1,3);

Code: [Select]
%length = 100;
%vector = vectorAdd(%cam.getEyePoint(), vectorScale(%cam.getEyeVector(), %length));
%ray = containerRayCast(%cam.getEyePoint(), %vector, $TypeMasks::All);
%position = getWords(%ray,1,3);
That code is exactly what I need, now (assuming firstWord(%ray) is a brick), how would I make it act like it was being activated?
%brick.onactivate or .activate does nothing :C

I'm  not 100% sure what the last two things are (I think clicked position and brick normal position) but this works:
%brick.onActivate(%player, %client, 0, 0);
« Last Edit: October 10, 2012, 02:40:05 PM by Trinick »


What
My bad. I orignally had it written as fxDTSBrick::onActivate but changed it to %brick.onActivate when I didn't know the names for the latter 2 arguments and forgot to remove %this.

Any idea for the crosshair?