Gib Spawner

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

DexterII

Overworked
Mar 22, 2001
1,115
0
0
44
Laboratory
www.ImAHosting.com
Ok, I've been trying to do this for some time now but can't figure out one thing. I'm trying to make a Gib Spawner, an actor to spawn gibs. Now I made an actor to randomly pick gibs and spawn them, that part works perfect, but the fact is the gibs don't move. I tried setting the physics etc, can anyone give me pointers. Or does anone know where or in what script it is written that when you die and break up into gibs is written so maybe that will tell me how UT handles the gibs. Thx.
 

EasyRaider

Crazy coder
Sep 21, 2001
74
0
0
43
Norway
Hmm, I'm think you'll need to set the gibs' velocities. They won't just fly off all by themselves.

You might want to check out TMaleMasterChunk and InitVelocity() in UTCreatureChunks.
 

DexterII

Overworked
Mar 22, 2001
1,115
0
0
44
Laboratory
www.ImAHosting.com
Code:
//=============================================================================
// GibSpawner.
//=============================================================================
class GibSpawner expands Effects;

Function PostBeginPlay()
{
Log("");
}

State() MaleGibs
{
	Function Trigger( Actor Other, Pawn EventInstigator )
	{
		Local TMaleMasterChunk M;
		Local Vector RandDir;
		
		M = Spawn(Class'TMaleMasterChunk');
		M.SetPhysics(PHYS_Falling);
		RandDir = 700 * FRand() * VRand();
		RandDir.Z = 200 * FRand() - 50;
		M.Velocity = (0.2 + FRand()) * (other.Velocity + RandDir);
		M.Velocity.X = Rand(10);
		M.Velocity.Y = Rand(10);
	}
}

Doesn't seem to move GRRRRR!!!!