UE3 - UDK Pickups-invisible

  • 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.

Mint92

New Member
Mar 16, 2012
28
0
0
How would go about creating Custom pickup that make the player invisible for a short period of time ?

for example i followed a tutorial that showed when a player fires using the link gun he appears, but when he doesn't he goes invisible.
Code:
class AwesomePlayerController extends UTPlayerController;

function NotifyChangeWeapon( Weapon PrevWeapon, Weapon NewWeapon)
{
	super.NotifyChangedWeapon(PrevWeapon, NewWeapon);

	if(Pawn == none)
		return;

	if(UTWeap_LinkGun(NewWeapon) != none)
		Pawn.SetHidden(true);
	else
		Pawn.SetHidden(false);
}

exec function StartFire( optional byte FireModeNum)
{
	super.StartFire(FireModeNum);

	if (Pawn !=none && UTWeap_LinkGun(Pawn.Weapon) !=none)
	{
		Pawn.SetHidden(false);
		SetTimer(1,False, 'MakeMeInvisible');
	}
}

function MakeMeInvisible()
{
	if(Pawn != none && UTWeap_LinkGun(Pawn.Weapon) != none)
		Pawn.SetHidden(true);
}
simulated event GetPlayerViewPoint(Out vector out_Location, out Rotator out_Rotation)
{
	super.GetPlayerViewPoint(out_Location, out_Rotation);

	if(Pawn != none)
	{
		Pawn.Mesh.SetOwnerNoSee(false);

	if(Pawn.Weapon != none)
		Pawn.Weapon.SetHidden(true);
	}
}

defaultproperties
{
}

could i copy of any of this code which will help me to create the invisibility pickup?
 
Last edited by a moderator:

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
The UDK already comes with a UT3 demo implementation. That one should also include timed powerups. I don't know whether it contains and the Invisibility, but even the UDamage should show you how such a pickup could work.