To enchance default control, add cam rotation with R click and drag; WASD movement, and zoom in out to change cam zoom
Open Top Down project
For TopDownCharcter BP (zoom on mouse scroll),
event graph:
Add varaibles and make graph:
Add new variable:
Continuefalse Branch, duplicate ending nodes paste there
Command on the BP
Add event tick, drag Spring arm component and use it to create set and get target arm length nodes
(should be FInterp to, no constant, speed 2)
Add new variable
Go to viewport, change spring arm rotation Y from -50 to -40;
target arm length to 1650
Back to event graph, change default spring arm length default value to 1650
continue the event tick graph
Set Camera Zoom difference value 500, Camera Position Int value 0 (play around these 2 values to give different zoom effect)
P.S. Don’t know yet how to set zoom in/out limit
For TopDownController BP (rotate cam on R click and drag):
Add the following Axis movement in Project setting, Input
Open the BP even graph, start by creating input axis lock yew and pitch nodes:
Promote variable form the multiphy node above, name as Camera rotation multiplier, set default value as 3
Add comment for whole nodes created as:
On look right/left and look up/down, check if right mouse is held down and if yes, then world rotation added for side rotation, while local rotation is added for vertical movement so that it does not switch directions once rotated horizontally past each quarter of a circle (90 degrees)
Change camera rotation multiplier default value to change the speed of rotation
Test the game if hold R click mouse can rotate the map
Moving with Keypad WASD:
Keep adding more Input for WASD keyboard movement (set minus sacle for S and A):
back to event graph, add new button BP
command as below
(for cast to BP topdowncharacter node, R click and choose conver to pure cast)
Add camera rotation limit/constraint:
Continue the graph “On look right/left....90 degrees” one by adding:
the clamp float node min (high angle, minus value) and max (low angle, plus value) value determine how much angle can be rotated to top and bottom