Announcement

Collapse
No announcement yet.

Player control problem

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

    Player control problem

    Hi there,

    I'm building a platformer for iOS and I'm in the final stages of development at the moment. The game works rather well when I test it on PC in the mobile previewer but when I cook the game and test it on my iPhone I get a little problem. I implemented four buttons for controlling the character (left, right, jump, shoot) through kismet and as I said it works just fine on PC. On the iPhone my character moves fine when I press the right button but when I press left it just keeps walking backwards instead of turning. For implementing the character movement I used the UDNPlayerController.uc provided by Epic and when playing the game on my device it feels like that whole bunch of code is being ignored. Does anyone know what could be the problem? Appreciate any help you can give me.

    Cheers!

    #2
    I tried cleaning up my code and used the sidescroller example code from

    http://udn.epicgames.com/Three/Camer...e.html#Example Side-Scrolling Camera

    Again it works just great in PIE but doesn't work on a device. Everything is ok except the player doesn't rotate (which works in Editor).

    Comment


      #3
      Hi,
      I remember this problem in one of my old projects and i hope i'm not mistaken here but what you have to change is the Mobile-UDKGame.uc with your own custom buttons.
      here is an example of a button from my old build :
      Code:
      [Accelerate_btn MobileInputZone]
      InputKey=GBA_MoveForward
      Type=ZoneType_Button
      bRelativeX=true
      bRelativeY=true
      bRelativeSizeX=true
      bRelativeSizeY=true
      RenderColor=(R=255,G=255,B=255,A=255)
      InactiveAlpha=0.8
      and then in kismet you only put the name of the button no need to specify the rest of the parameters since you already did in the file and in this case the nameof the button is Accelerate_btn and there the magic it will work in the device.

      Hope it helps and cheers
      Lost1990

      Comment


        #4
        Thank you, lost1990
        I tried but sadly is not working. I must be missing something. In the editor I'm using GBA_StrafeLeft and GBA_StrafeRight for movement. Somehow this doesn't reflect on the device. I deleted everything from the buttons except the name as you suggested but then the button doesn't do anything. If i put GBA_StrafeLeft/Right under "Input Key" it moves forward and back but doesn't rotate again. Fire and Jump work just fine btw


        Still thanks for trying. If you think of anything else, let me know

        Btw you did mean Mobile-UDKGame.ini and not .uc right?

        Comment


          #5
          Ok,
          I was finally able to pinpoint the problem. I was referencing UTPawn and UTPlayerController for my classes and it seems that's a big 'NO' for iOS games. I tried referencing UDKPawn or something else but then i get a whole other bunch of problems.

          EDIT:
          There i fixed it. Everything started working once I moved away from UTPawn and UTPlayerController.

          Comment


            #6
            How did you implement the jump and shoot button?

            Comment


              #7
              Never mind, I got it.

              Comment

              Working...
              X