Announcement

Collapse
No announcement yet.

WIP Hax Hazard-mini game

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    WIP Hax Hazard-mini game

    heres a mini game ive been working on in my spare time i know its far from polished, im going to add some more random barriers and keys to unlock, possibly exp and leveling up

    let me know any thoughts

    #2
    It seems, your pawn doesn't have PHYS_Walking.

    Comment


      #3
      thanks buddy :P

      class MyPawn extends UTPawn;


      var float CamOffsetDistance; //distance to offset the camera from the player in unreal units
      var float CamMinDistance, CamMaxDistance;
      var float CamZoomTick; //how far to zoom in/out per command
      var float CamHeight; //how high cam is relative to pawn pelvis

      //stop aim node from aiming up or down
      simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp)
      {
      super.PostInitAnimTree(SkelComp);
      AimNode.bForceAimDir = true; //forces centercenter
      }

      simulated event PostBeginPlay()
      {
      super.PostBeginPlay();
      `Log("Custom Pawn up"); //debug

      }

      //override to make player mesh visible by default
      simulated event BecomeViewTarget( PlayerController PC )
      {
      local UTPlayerController UTPC;

      Super.BecomeViewTarget(PC);

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

      //only update pawn rotation while moving
      simulated function FaceRotation(rotator NewRotation, float DeltaTime)
      {
      // Do not update Pawn's rotation if no accel
      if (Normal(Acceleration)!=vect(40,-75,40))
      {
      if ( Physics == PHYS_Ladder )
      {
      NewRotation = OnLadder.Walldir;
      }
      else if ( (Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
      {
      NewRotation = rotator((Location + Normal(Acceleration))-Location);
      NewRotation.Pitch = 0;
      }

      SetRotation(NewRotation);
      }

      }


      //orbit cam, follows player controller rotation
      simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
      {
      local vector HitLoc,HitNorm, End, Start, vecCamHeight;

      vecCamHeight = vect(0,0,0);
      vecCamHeight.Z = CamHeight;
      Start = Location;
      End = (Location+vecCamHeight)-(Vector(Controller.Rotation) * CamOffsetDistance); //cam follow behind player controller
      out_CamLoc = End;

      //trace to check if cam running into wall/floor
      if(Trace(HitLoc,HitNorm,End,Start,false,vect(12,12 ,12))!=none)
      {
      out_CamLoc = HitLoc + vecCamHeight;
      }

      //camera will look slightly above player
      out_CamRot=rotator((Location + vecCamHeight) - out_CamLoc);
      return true;
      }

      exec function CamZoomIn()
      {
      `Log("Zoom in");
      if(CamOffsetDistance > CamMinDistance)
      CamOffsetDistance-=CamZoomTick;
      }

      exec function CamZoomOut()
      {
      `Log("Zoom out");
      if(CamOffsetDistance < CamMaxDistance)
      CamOffsetDistance+=CamZoomTick;

      }

      defaultproperties
      {
      CamHeight = 80.0
      CamMinDistance = 40.0
      CamMaxDistance = 350.0
      CamOffsetDistance=250.0
      CamZoomTick=20.0




      }






      Sorry if thats a bit messy but how would i change my physics? ...just add Physics=PHYS_walking to Default properties? please help

      Comment

      Working...
      X