Home Unreal Engine

''Bad command or expression'' - help!

Meanwhile in Unrealscript, I was making subclasses ect. For a 2D scroller based game i'm working on, BUT! When I go to compile I get this error:

''Error, 'Set MeshVisibility': Bad command or expression''

I don't understand why I get this error :poly122:
Can somebody point me in the right direction please!

Heres the code:

class UDNPawn extends UDKPawn;

var float CamOffsetDistance; //Position on Y-axis to lock camera to

/*override to make player mesh visible by default*/
simulated event BecomeViewTarget( PlayerController PC )
{
local UDKPlayerController UDKPC;

Super.BecomeViewTarget(PC);

if (LocalPlayer(PC.Player) != None)
{
UDKPC = UDKPlayerController(PC);
if (UDKPC != None)
{
/*set player controller to behind view and make mesh visible*/
SetMeshVisibility(UDKPC.bBehindView);
UDKPC.bNoCrosshair = true;
}
}
}

simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
{
out_CamLoc = Location;
out_CamLoc.Y = CamOffsetDistance;

out_CamRot.Pitch = 0;
out_CamRot.Yaw = 16384;
out_CamRot.Roll = 0;
return true;
}

simulated singular event Rotator GetBaseAimRotation()
{
local rotator POVRot;

POVRot = Rotation;
if( (Rotation.Yaw % 65535 > 16384 && Rotation.Yaw % 65535 < 49560) ||
(Rotation.Yaw % 65535 < -16384 && Rotation.Yaw % 65535 > -49560) )
{
POVRot.Yaw = 32768;
}
else
{
POVRot.Yaw = 0;
}

if( POVRot.Pitch == 0 )
{
POVRot.Pitch = RemoteViewPitch << 8;
}

return POVRot;
}

defaultproperties
{
CamOffsetDistance=0.0
}




Thanks

Replies

  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 19
    Hm... You're trying to use the bBehindView variable in the SetMeshVisibility function, that variable IS declared in the UTcontroller..but not in the UDKcontroller class. You can either: switch to using the UTController classes, OR Extend UDKController and 'reimplement" the bool there(as well as whatever adjusts in in UTController).

    Heck, since it seems like you're trying to force visibility you could also just force a 'true' in that function all --setmeshvisibility(true)--

    That might get you moving towards compiling and seeing what other stuff there is to fix.
Sign In or Register to comment.