Hello
I’m trying to create a RTS-like camera system
After examining the Strategy game code, I’ve noticed that all the camera logic was done in a custom camera component (extended from UCameraComponent) so I’ve decided to do the same
However i cant add code to project in the editor because UCameraComponent class do not appear in the editor
Trying to create that class manually results in compile errors (Im not quite sure if I’ve done it well either)
So can someone please explain why it is not working ? Or could someone explain me how to create such class?
Well in your case your could control camera manually with APlayerCameraManager which each Player Controller (which is made for player) has as a pointer to in PlayerCameraManager. in which you can control camera view, so you dont need to play with camera components which is used to attach camera to actor which you don’t need as you making RTS
Hello and thanks for replying
the compile error that i get when i declare my custom camera component to use in the charcter headers is
error C2065: 'UHSG_CameraComponent' : undeclared identifier
error C2923: 'TSubobjectPtr' : 'UHSG_CameraComponent' is not a valid template type argument for parameter 'SubobjectType'
The strange part is that UHSG_CameraComponent compiled with no error as long as my character do not use it
By the way to create UHSG_CameraComponent i first created a class extended from Actor and then inside the class i renamed and reextended from UCameraComponent (so that is why im not sure that it is the good way)
Hi thanks for answering
Well StrategyGame use a hidden pawn which is why it uses camera component i believe
One thing i did not know is that camera can be remain unattached
Thanks for the suggestion i will try it
Im actuallly using RTS camera system but planning to have MOBA gameplay (you control a pawn but camera can go anywhere)
Do think it is better to use a custom camera manager rather than a custom camera component ?
I’m asking myself the same thing. I’ve been trying out having a pawn own the camera, the player controller owning the camera and using a standalone PlayerCameraManager. I’m not sure which practise I like best. Trying to keep most of it in C++, but I’m not sure if I maybe want to use blueprints for the bounds-checking with the cursor and so forth. Any ideas?
I really does not really matter, whatever you think it’s easier for you I personally learned to control camera by manipulating camera management in UDK. I just think since you not pawn or anything, just flying around, you could just make camera to behave like that without of using any actor. Also you did custom camera component, then i guess you can do custom camera menager if you really want to change behavior of camera
Aslo sorry for late reponce, i didn’t notice that you commeted