This is from click push:
function Player::activateStuff(%player)
{
%v = Parent::activateStuff(%player);
%client = %player.client;
if(!$ClickPush::Status || (!%client.isAdmin && $ClickPush::AdminOnly))
return %v;
%target = containerRayCast(%player.getEyePoint(),vectorAdd(vectorScale(vectorNormalize(%player.getEyeVector()),2),%player.getEyePoint()),$TypeMasks::PlayerObjectType,%player);
if(!isObject(%target) || %target == %player || %player.getObjectMount() == %target)
return %v;
%target.setVelocity(vectorAdd(%target.getVelocity(),vectorScale(%player.getEyeVector(),$ClickPush::Amount)));
return %v;
}
It detects if the target is a player, but I want it to detect if the target is an item, and fling it towards them instead of away.
How do you detect if the object is an item? And how do you fling it towards the player?
If I want a larger radius of detection than the size of the item, would I need to use a raycast instead of this line of sight from clickpush?