1. I'm trying to draw a sphere on the bullets position every 1 seconds while it is in the air, but it draws the sphere at worldcoords(0,0,0) does someone know what I am doing wrong.
    Thank you.

    Code:
            void OnWeaponFired(BaseProjectile baseProjectile, BasePlayer player, ItemModProjectile projectile, ProtoBuf.ProjectileShoot projectiles)        {
                Puts("OnWeaponFired works!");
                timer.Repeat(1f, 5, () => drawSphere(baseProjectile, player, projectile, projectiles));
            }
            public void drawSphere(BaseProjectile baseProjectile, BasePlayer player, ItemModProjectile projectile, ProtoBuf.ProjectileShoot projectiles)
            {
                Puts(baseProjectile.transform.position.ToString());
                player.SendConsoleCommand("ddraw.sphere", 0.5f, Color.red, baseProjectile.transform.position, 1f);
            }
    [​IMG]
     
    Last edited by a moderator: Jul 28, 2015
  2. Code:
    void OnWeaponFired(BaseProjectile baseProjectile, BasePlayer player, ItemModProjectile projectile, ProtoBuf.ProjectileShoot projectiles)        {
              
                var prefab = projectile.projectileObject?.Get();
                        var projectile2 = prefab?.GetComponent<Projectile>();
               
           
               timer.Repeat(1f, 5, () => Puts(projectile2.currentPosition.ToString());
               
               
            }

    BUT this value is Private......and dont work
     
  3. Wulf

    Wulf Community Admin

    Use reflection.
     
  4. It won't help him. I did this and it still returned 0 0 0.
     
  5. Yep tried it. Still 0 0 0 . that gets me in mind..... you can turn on the " vis.attack " in your console . is there not any way to use that ?