1. Hi all. Does anyone know how to determine the world position of a player's held weapon? I'm trying to run a server effect at said position, but I can't seem to resolve it. The closest I've been able to get is near the player's feet. I've tried a number of methods on the weapon as BaseEntity, BaseProjectile, HeldEntity, weapon.model.transform.position, etc, but to no avail. And after digging through the libraries for too long, I've still not found a solution... Any help is greatly appreciated!
     
  2. Code:
    BaseEntity entity = player.GetHeldEntity();
    Puts("Location Of Held: {0}", entity.transform.position);
    //Returns the held location of the entity/weapon?!?
     
  3. Thanks, but I tried that, and it was returning a position closer to the player position than the actual weapon position. Anyway, I found a workaround - instead of trying to find the position of the weapon, I can pass the weapon entity directly to Effect.server.Run:
    Code:
    Effect.server.Run(effectString, weaponEntity, StringPool.closest, Vector3.zero, Vector3.zero);
    Although I don't have a good solution to my original question, I think this thread is resolved.
     
  4. It was probably giving you the stock of the weapon or something around those lines. Most likely not just the center of it.