Author Topic: Getting the ID of an brick you're looking at?[Solved]  (Read 861 times)

So far I have:

Code: [Select]
%targ = containerRayCast(%client.player.getEyePoint(), vectorAdd(vectorScale(VectorNormalize(%client.player.getEyeVector()), 5), %client.player.getEyePoint()), $typeMasks::FxBrickObjectType).client;
I want this to get the ID of a music brick, however it does not work, any help?
« Last Edit: September 23, 2012, 12:19:11 PM by ¥ola »

Try running a trace of /getid.

erm, why do you have .client attached to the end of that raycast...

Well...
I ran a trace of getID and that didn't really do me much good, I looked through it and it just seems to get the numbers... Magically.

Also, I have no idea why I have .client on the end, I was just playing with this code

Your code is pretty messy, and you have some redundancy in there. Anyways, the raycast will return the ID of the first item it hits matching the mask

This is what it should be
Code: [Select]
%eyePoint = %player.getEyePoint();
%id = containerRayCast(%eyePoint,vectorAdd(vectorScale(%player.getEyeVector,5),%eyePoint),$TypeMasks::FxBrickObjectType);
You don't need to normalize the vector because it already is

I really have to stop making these topics, :/
I already had it figured out by the time you replied...

Anyways, thanks to everyone !