This is very frustrating, no matter what I do I cannot get the player to mount an object.
This is what I've tried(both with a gunitem and a custom staticshape)
if(!isobject(%obj.client.player.targetobject)){
%obj.client.player.targetobject = new Item()
{
position = %obj.client.player.getTransform();
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "GunItem";
};
%obj.client.player.mountObject(%obj.client.player.targetobject,$headSlot);
}
This is in the
function ProjectileData::onCollision(%this,%obj,%col,%fade,%pos,%normal){}
function, which is in a package.
This is for a stupid workaround I'm attempting in order to get %bot.setaimobject(%object) to aim better, by mounting an object on the player's head and then telling it to aim there.
I could stick a %bot.setaimlocation(vectoradd(%object.getposition(),"0 0 1")); in a fast running schedule but I'd rather let the C++ handle it.