Supply drop effect on land?
I am making an airdrop plugin for a mars themed map and want to make it have kinda like a boost back effect when it lands. I basically just need the heli rocket effect to play at the bottom of the drop when it touches ground. I made this so far but there are two problems, 1. the effect happens on where the signal was and not on the drop. 2. the effect doesn't play when the airdrop lands. Can anybody help me?
 Vector3 Getplayervector(Vector3 pos)
        {
            float x = pos[0];
            float y = UnityEngine.Random.Range(350, 450);
            float z = pos[2];

            return new Vector3(x, y, z);
        }

        Vector3 Getdropvector(Vector3 pos)
        {
            float x = pos[0];
            float y = 0;
            float z = pos[2];

            return new Vector3(x, y, z);
        }


void Spawnplayerdrop(Vector3 pos)
        {
            
            Vector3 position = Getplayervector(pos);
            Vector3 effectpos = Getdropvector(position);

            BaseEntity supplydrop = GameManager.server.CreateEntity("assets/prefabs/misc/supply drop/supply_drop.prefab", position, new Quaternion(0f, 0f, 0f,0f));

            supplydrop.Spawn();
            SupplyDrop drop = supplydrop as SupplyDrop;
            drop.GetComponent<Rigidbody>().drag /= config.settings.fallspeed;
            drop.RemoveParachute();
            
            if (config.settings.useboostback == true)
            {
                    if (drop.transform.position.y == 0)
                    {
                        Effect.server.Run(effect, effectpos);
                        Puts("dropped");       
                    }    
            }
        }​
` the effect doesn't play when the airdrop lands`
Because you run it only when Y is 0. If drop landed it doesnt means Y is zero
5ba216a6d7f65.png Orange
` the effect doesn't play when the airdrop lands`
Because you run it only when Y is 0. If drop landed it doesnt means Y is zero

Is there a way to define when the airdrop touches ground?

5ee8d1e1c84dc.png Kingfoo55

Is there a way to define when the airdrop touches ground?

You can check that in SupplyDrop class

5ba216a6d7f65.png Orange

You can check that in SupplyDrop class

So i could use something like if drop.isLootable. But i still am struggling on how to check this. As right now it checks as sson as it drops and obviously that won't work. How do i make it check until it reaches ground?

There's a hook that goes off when it lands, OnSupplyDropLanded.
Zugzwang
There's a hook that goes off when it lands, OnSupplyDropLanded.
omg i dont know how i didnt see that. Thanks :)
Looks like any collision with the SupplyDrop can call that hook.

You might need to attach a component to it that watches for its velocity to reach 0.
Zugzwang
There's a hook that goes off when it lands, OnSupplyDropLanded.
but if i want to do the boost back thing i kinda want it to trigger before it lands, is there an easy way to define like just before it hits ground
Zugzwang
Looks like any collision with the SupplyDrop can call that hook.

You might need to attach a component to it that watches for its velocity to reach 0.
is there a component that checks for distance from ground?
I think you would have to to make your own. 

Look at HotAirBalloon.UpdateIsGrounded() for an example of checking for the ground.
Zugzwang
I think you would have to to make your own. 

Look at HotAirBalloon.UpdateIsGrounded() for an example of checking for the ground.

i dont understand how to inspect it. i cant see what the function is doing.

sorry for being a pain.
You have to point a decompiler at it to see what's happening on the inside.
Zugzwang
You have to point a decompiler at it to see what's happening on the inside.

do you have any recomendations on a good one?

I use JetBrains dotPeek.  Not sure how it compares to others; it's the only one I have tried.