maybe first, what I try to do. I have a PlayerCharacter which should only be able to move inside the camera constraints. With an orthographic camera postion x = 0, y = 0 and z = 10000 and an orthographic width of 3000 my Player Character should be able to walk -1500 left, 1500 right and lets say with an aspect ratio of 1 the same for up and down. Doesnt Matter for my Problem.
I have the movement in place, I clamp it to a fixed value right now in the PlayerController Class. But I want to vary the orthographic width while playing, so I have to let th Player Controller know what the actuall orthographic width is. Due to the fact that the Player Controller isnt a default blueprint I have some problems with that.
The Player Controller cant have Objects as public variables. You can add them as public but they dont get exposed to edit them. Most likely because the player Controller is instanticated before the map and therefore does not know about any Actor objects, it only know about actor classes. (Right??)
My Main Camera is also a Blueprint where I blend to with Game Start Event.
I added an Interface to the Main Camera Blueprint with a return value of the Camera orthographic width.
Inside the Player Controller I added a Varible to the Main Camera CLASS (as said object is not possible or I do something wrong).
- Now I try to get all instances of the main camera (see Screenshot, this isnt ment as a final solution, it is for testing only!) and use the interface to get the camera orthographic width. But that is not working at all. The array of cameras is alway 0 but I have a “TheMainCamera” instance in the View which is working fine.
Is my Setup Wrong?
Is there some kind of a Blueprint singelton so you dont have to loop through all instances when you already know there is only one (in this example) main camera?
Thanks for reading and best regards,