Hello Guys I have a Problem with the client/server camera. When Client Press the key to change the camera to GunCamera It change to GunCamera But in the servers one. not in the Client.
But if the server press the key to change the camera it works fine.
If you are using input events, then they should be called on the client anyway. Where is your “GunCamera” reference getting created? Are you sure it is set on both the server and client? If it is set on the server, you should set the GunCamera variable to replicate.
To begin debugging, I would set up an event specifically called on the clients to ensure that the logic is getting called. But as I said, from an input event, this shouldn’t be necessary.
“SetViewTargetWithBlend” isn’t a node I have used before, so I have just created a networked project and tried it out.
I am assuming that the “Gun camera” is used as a like a scoped view right?
The server doesn’t really need to know if the camera is aiming down a scope. This type of functionality is only relevant to the client.
If this solution doesn’t work for you. Let me know in a bit more default what you are trying to achieve (including any data you would like replicating) and I will take another look.
This error looks like you trying to break a hit result from an overlap/collision event. Your code could be assuming that this object will always be a soldier, but without seeing the code I can only speculate.
I would make sure you add “IsValid” checks before accessing properties of references you’ve stored at runtime.
My last piece of advice would be to pay attention to your naming. Keep objects and variables named appropriately will make it simpler when debugging and for anyone else reviewing your code.
As mentioned in my last answer. If the solution isn’t correct, or I have misunderstood what you are trying to achieve, let me know and I will take another look.