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.

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.

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).

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:

1.png

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.

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.

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.

Thanks. Will do.

I don’t see it… do you guys see it there?

I think I found it here: GitHub - youlanhai/StrategyGame but it’s 4 years old and I can’t get it to compile.

Running C:/Program Files/Epic Games/UE_4.24/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“C:/Code/StrategyGame/StrategyGame.uproject” -game -rocket -progress -log=“C:\Code\StrategyGame/Saved/Logs/UnrealVersionSelector-2020.05.15-16.59.48.log”
Discovering modules, targets and source code for project…
While compiling C:\Code\StrategyGame\Intermediate\Build\BuildRules\StrategyGameModuleRules.dll:
c:\Code\StrategyGame\Source\StrategyGame.Target.cs(19,12) : error CS0246: The type or namespace name ‘UEBuildBinaryConfiguration’ could not be found (are you missing a using directive or an assembly reference?)
c:\Code\StrategyGame\Source\StrategyGame.Target.cs(54,26) : error CS0246: The type or namespace name ‘GUBPFormalBuild’ could not be found (are you missing a using directive or an assembly reference?)
c:\Code\StrategyGame\Source\StrategyGameEditor.Target.cs(19,12) : error CS0246: The type or namespace name ‘UEBuildBinaryConfiguration’ could not be found (are you missing a using directive or an assembly reference?)
c:\Code\StrategyGame\Source\StrategyGameEditor.Target.cs(25,21) : error CS0246: The type or namespace name ‘GUBPProjectOptions’ could not be found (are you missing a using directive or an assembly reference?)
ERROR: Unable to compile source files.