PDA

View Full Version : bCanStrafe=False won't work



FrozenDozer
11-12-2009, 11:57 AM
Well, all I wanted is a non strafeable playercharacter.
I altered 3 Scripts, as I was told.

Here's the code:


class JumpNRunPlayerController extends UTPlayerController;

defaultproperties
{
Name="Default__JumpNRunPlayerController"
}




class JumpNRunPawn extends UTPawn;

defaultproperties
{
Begin Object Name=WPawnSkeletalMeshComponent
bOwnerNoSee=false
End Object
Name="Default__JumpNRunPawn"
bCanStrafe=false
}


class JumpNRunGameInfo extends UTDeathmatch;

defaultproperties
{
Acronym="JNR"

MapPrefixes.Empty
MapPrefixes(0)="JNR"

DefaultMapPrefixes.Empty
DefaultMapPrefixes(0)=(Prefix="JNR",GameType="JumpNRun.JumpNRunGameInfo")

PlayerControllerClass=class'JumpNRunPlayerControll er'
DefaultPawnClass=class'JumpNRunPawn'

Name="Default__JumpNRunGameInfo"
}

Well, UnrealFrontend says "0 errors 0 warnings"
But the thing is: players and bots still can strafe. Did i miss something?

immortius
11-12-2009, 03:51 PM
Are you running your gametype? i.e. running udk like

udk dm-deck?game=MyMod.JumpNRunGameInfo

Anyhow, I believe that variable is just an adviser to AI as to whether the pawn can strafe or not, so it probably doesn't affect player movement at all.

FrozenDozer
11-12-2009, 05:26 PM
Yeah, I'm running the Gametype.
The Script SHOULD work, but it doesn't.

Any Idea how I could solve this? I want some Jump n Run Movement, so just move forward and backwards and I want to get rid of the strafing.

marilol
11-12-2009, 05:31 PM
This jsut tells the default ai they can't strafe, it has no affect on whether they can or will.

To stop strafing I modified the MoveX factor or sumin in the input file via a custom controller class. Also, you cans et the bots ability to strafe properly in a custom Bot Class.

FrozenDozer
11-15-2009, 06:07 PM
Got it working now, thank you :)