Author Topic: Spawning an Item in Front of the Player  (Read 550 times)

I currently have a /drop command but I'm not sure about how to do the above. I can spawn it above the player and push it in the right direction but I want to create an object in front of the player, where they are looking. Any ideas?

Do you need the position or something?
Code: [Select]
function getPosInFrontOfPlayer(%player,%dist)
{
    return vectorAdd(%player.getEyePoint(),vectorScale(%player.getEyeVector(),%dist))
}

Do you need the position or something?
Code: [Select]
function getPosInFrontOfPlayer(%player,%dist)
{
    return vectorAdd(%player.getEyePoint(),vectorScale(%player.getEyeVector(),%dist))
}
That should work. I'm not good with this sort of stuff.