Announcement

Collapse
No announcement yet.

Newbie needs help. Making Pawn that doent have a camera child? Eg. For Space Invaders games etc

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

    Newbie needs help. Making Pawn that doent have a camera child? Eg. For Space Invaders games etc

    Hello all. I am trying to learn UE4 after using many other engines and frameworks in the past.

    I am very much stuck and tried many tutorials but they all seem to have a Pawn with the camera as the child.

    Many of my game ideas this wouldn't be very suitable (just some examples: Fixed camera one screen games such as Space Invaders of Frogger style / R-Type style games / Sports games / 2 player games with shared camera etc etc etc)

    I tried butchering info from all tutorials I could find, but whenever I 'Start' the game, there is a camera put where my cursor in editor was.

    What is the best way to make a game, very much like Space Invaders, so one camera which doesnt move, but the player sees his space ship at the bottom and can move it? Why does/should the Pawn always have a camera component?

    Perhaps the answer is that UE4 is more tailored to games that have a upright character or at least that want a camera as part of the child.

    In other engines I have used. I could just add a script as a component to any object, this could include a movement script to react to any input data. It seems in Unreal I have to actually extend PawnMovementComponent in order to access the Axis or Actions data. This seems to have a side-effect of adding the camera to my project.

    Sorry for the open-ended question, but I am looking for general guidance to make arcade style games and to gain a better understanding in general of the engine.

    #2
    If you don't need any of the Pawn features you could simply use an Actor and enable input on it. Add the input actions you need from there.

    Comment


      #3
      Ah great thank you for the reply. Somehow I had it stuck in my head from reading somewhere that I needed a customised Pawn. I was thinking there must be a way to use an Actor. So is there an Input Component to 'CreateDefaultSubobject' of, or do I have to extend an Input class with my custom Actor class? (Sorry I am really confused and really I don't want to build all the functions in Blueprint nodes, I want to do the bulk of it in code).

      Comment


        #4
        Hello!

        I'm not entirely sure if this is what you're looking for, but some time ago I made a little torch that could be reignited or doused with a key input while being independent from the camera.

        So I declared APlayerController* Controller in the header and then did this in BeginPlay:

        Click image for larger version

Name:	1.png
Views:	85
Size:	24.0 KB
ID:	1712484

        You can setup independent cameras or roam around the level freely with the default camera and the actor will always receive your inputs.

        Also note that GetFirstPlayerController will most likely only work in a single player game, I haven't studied how to make a multiplayer game yet, so I don't know any other way.

        Comment


          #5
          Thank you very much. This looks to be exactly the kind of thing i need. I'm slowly working through some more tutorials and hopefully repeating all the basics enough I will eventually learn without needing to follow others examples to actually build something working.

          Comment


            #6
            For an advanced implementation of a top-down camera that is constrained to fixed bounds and independent of any specific Actor, check out the Tower Defense demo project available from the Unreal Engine > Learn tab in the Epic Games Launcher.
            Marketplace: Remapt: Input Remapping System
            Tutorials: Unrealistic

            Comment


              #7
              Thanks. Will do.

              Comment

              Working...
              X