mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 23:50:29 +01:00
Fixed flares spawning upright
This commit is contained in:
parent
773f76a7de
commit
99cb039797
1 changed files with 13 additions and 8 deletions
|
|
@ -193,15 +193,20 @@ namespace SceneManager
|
||||||
private static void SpawnFlare()
|
private static void SpawnFlare()
|
||||||
{
|
{
|
||||||
var flare = new Weapon("weapon_flare", shadowBarrier.Position, 1);
|
var flare = new Weapon("weapon_flare", shadowBarrier.Position, 1);
|
||||||
//flare.SetPositionWithSnap(shadowBarrier.Position);
|
|
||||||
|
|
||||||
// The purpose of this fiber is to allow the flare to spawn and fall to the ground naturally before freezing its position because you can't spawn it on the ground gracefully (it stands upright)
|
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(flare, true);
|
||||||
//GameFiber.StartNew(delegate
|
GameFiber.StartNew(() =>
|
||||||
//{
|
{
|
||||||
// GameFiber.Sleep(1000);
|
while (flare && flare.HeightAboveGround > 0.05f)
|
||||||
// flare.IsPositionFrozen = true;
|
{
|
||||||
// flare.IsCollisionEnabled = false;
|
GameFiber.Yield();
|
||||||
//});
|
}
|
||||||
|
GameFiber.Sleep(1000);
|
||||||
|
if (flare)
|
||||||
|
{
|
||||||
|
flare.IsPositionFrozen = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
barriers.Add(flare);
|
barriers.Add(flare);
|
||||||
removeBarrierOptions.Enabled = true;
|
removeBarrierOptions.Enabled = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue