I keep getting an error saying accessed none trying to read camera manager for player index 1. I don’t think I set it up right. I cannot use the same player index 0 because otherwise both the camera rotation limits will be the same, how do I fix the error?
Thank you for any answers
(note: i asked this question in another category but ill ask here also in case anyone has any ideas)
Normally you can resolve ‘accessed none’ errors with an ‘is valid’ check.
I see that your ‘Get Camera Manager’ is running on BeginPlay. Sometimes things need a few frames to initialize, so you could also just try putting a tiny delay after BeginPlay.
Hello, thank you for your reply, I tried it out and looks like its not the case.
if you have any insights on how player controller index works please let me know because I really just want my two characters to be standalone but it seems they’re connected somehow (they aren’t child or parents of eachother) but whenever I make changes to one it still implments in the other which i’m assuming is because theyre still using the same player controller (I have no idea how to change it, I didn’t think it would be this complex)
Get Player Controller 0 is the one for the character of the “main” player and it is given to you by the GameMode. In a multiplayer scenario, if the host calls Get Player Controller 0 he will get it’s own controller. If the client calls Get Player Controller 0 he will also get its own controller, and not the hosts.
When you want the player to possess another character just use Get Player Controller 0. Or is it that you want to have different logic inside each controller?
Are the characters different? Or you made it that way so you can switch between first and third person camera?
Do you have other characters on the map? Or you are testing only with the main character?
But when switching player characters to the first person, it doesn’t disable movement, and the first person character is still able to move freely? here’s the code:
Maybe I shouldn’t attach it to begin play but somewhere else? I have no clue though.
Here is a video demonstrating, it’s very buggy so please ignore that. Starts off as my third person character then switches to first person character it shouldn’t be able to walk around, but it can.
Also when I add camera yaw min and max limits to the first person BP, it takes effect in BOTH my blueprints when they should be separate.
Thank you for your patience and trying to solve this.
Well from this video I might be wrong but isn’t that the same character, in the same location, so you don’t need two of them, just change the camera location from 3rd person to 1st person.
The camera is moving too fast to get that right.
If I’m wrong and the characters are actually in two different location, when you press a button you want switch between the two locations/characters?
Yes they are in two different locations hence why I decided to use two different characters, sorry the video isn’t very good. From the code I showed before, the player switches when pressing ‘G’ AND overlapping with trigger box.
I just wanted to show you that my first person character is able to walk around when I literally disabled it’s movement.
Well it depends. You can use the same character and when you switch between the locations you can add/remove the limit, but that would mean that you have to “teleport” the character around the map, but maybe you want to have both of them on the map.
When a controller possesses another character, the old character should stop moving (if you don’t have some functions to force the movement), but it’s animation can get stuck into the moving state, and it will animate the running while standing in the same place.
In this situation you must be sure that when you want to move to the next character it actually exist on the map, and simply call Posses for controller 0.
Make sure that you don’t have conflicting events in you player controller and character blueprints.
Hello all, thank you for your replies, I will be closing this topic because I will be re-designing the system and trying something else, while I don’t have any solutions, I will try to solve the problem in a different way. You can check my page in the future in case I come up with any solutions to this.