BearBear
07-25-2011, 05:06 AM
Ok this is similar to a previous question I asked but slightly different. I have a
Controller class
class Cont extends UTPlayerController;
var bool menuActivated;
var MenuActor menu;
exec function Print_I_Mssg()
{
if(menuActivated == false)
{
Player.Actor.clientMessage("Menu On");
menu.Spawn(class'MenuActor', Player.Actor, 'menu', Player.Actor.Location);
menuActivated = true;
}
else
{
Player.Actor.clientMessage("Menu Off");
menuActivated = false;
}
}
and a child of actor
class MenuActor extends Actor
placeable;
var() const editconst DynamicLightEnvironmentComponent LightEnvironment;
DefaultProperties
{
Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
bEnabled=true
End Object
//LightEnvironment=MyLightEnvironment
Components.Add(MyLightEnvironment)
Begin Object class=SpriteComponent Name=Sprite
Sprite=S_Actor
HiddenGame=False
End Object
Components.Add(Sprite)
}
I am just trying right now to spawn it at the players location. The code compiles and everything but I can't get it to show on screen.
I just want the sprite to appear at the players location when a button is pressed. I can detect the button press as it displays the correct client messages but the item is not spawning. is there some type of bShow that i need to set to true or something? Ty in advance
Controller class
class Cont extends UTPlayerController;
var bool menuActivated;
var MenuActor menu;
exec function Print_I_Mssg()
{
if(menuActivated == false)
{
Player.Actor.clientMessage("Menu On");
menu.Spawn(class'MenuActor', Player.Actor, 'menu', Player.Actor.Location);
menuActivated = true;
}
else
{
Player.Actor.clientMessage("Menu Off");
menuActivated = false;
}
}
and a child of actor
class MenuActor extends Actor
placeable;
var() const editconst DynamicLightEnvironmentComponent LightEnvironment;
DefaultProperties
{
Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
bEnabled=true
End Object
//LightEnvironment=MyLightEnvironment
Components.Add(MyLightEnvironment)
Begin Object class=SpriteComponent Name=Sprite
Sprite=S_Actor
HiddenGame=False
End Object
Components.Add(Sprite)
}
I am just trying right now to spawn it at the players location. The code compiles and everything but I can't get it to show on screen.
I just want the sprite to appear at the players location when a button is pressed. I can detect the button press as it displays the correct client messages but the item is not spawning. is there some type of bShow that i need to set to true or something? Ty in advance