I have create a default player controller. The player should only be a camera looking from above and everything should be controlled by the mouse. I have successfully set the initial rotation in the blueprint of the player controller. I am not sure I am doing this the right way though.
How do I restrict the movement to only the X and Y planes?
The MovementComponent has a constrain to plane feature where, and you can provide the normal of the plane you want the actor constrained to. So in this instance, the normal (0,0,1).
If you look at how the controller is set up in the third person perspective sample project it only adds rotation from the controller for yaw rotation which only allows rotation in XY plane.
move forward and move right provide propulsion based on the current forward and right vectors of your player so these should only provide movement based on the allowed rotation.
I cannot seem to find the MovementComponent. The only component there is is a TransformationComponent that is inherited. I cannot seem to find a way to add the MovementComponent to the PlayerBlueprint from the Add Component Menu.
Ok, you need to create a blueprint character, that just has a camera pointing downwards … this character blueprint will then have all the the parts you need to move your “camera” around as a player
You can remove the mesh since you dont want a physical representation for the player, but you will need to add a camera and rotate it to where you want it
You will then need to set the default pawn to this blueprint character
I’m a bit confused by your wording. Do you want to constrain the movement of the PlayerController or the Pawn/Character? You should be using Pawn or Character for any player controlled objects for the most part, and those come with movement components, which you can then change the constraint plane on.
Characters have Character Movement Components, and Pawns have Pawn Movement Components. You can see an example of constrain to plane in the Side Scroller example.
So do you want to constrain the movement of the controller? I don’t understand why you don’t have a pawn unless you’re building a game in which the player controls many pawns. In which case, you should go to the Learn tab in the Unreal Launcher and check out the Strategy Game example project.
In the GameMode the pawn is at it’s default i.e which is a C++ core class which won’t be very good to change. In game there is no visible pawn. I want it to be like an RTS where you have a camera and restricted only in the XY plane and that has no actor associated with it.