I found and reproduced very strange bug: I created actor with scene capture 2d component. Then i created child actor component in character BP. In character BP, in runtime im setting child actors class (with spacebar key) to class with scene capture component. As you can see in video, server’s child actor attached on spring arm not rotating in pitch, but clients rotating properly… I tried to attach child actor to camera, but with same results.
I found 2 issues in your BP. first, the issue about pitch was easily fixed by just moving the static mesh to be a child of the camera, but if you want more flexibility, i added extra logic you can actually use if you intent to replicate the pitch/yaw animation on other clients. (pitchyawreplication.jpg). i also set every single setting into the details section to the defaults, seems like you were clicking a lot of stuff on and off (causing weird movement on the character too).
second was the material generation. the first one that set the class to the child actor was the only one rendering the image. im not too experienced on this but i think cause you are sharing one same material across the game. for this, i created a material instance, a render target 2d and set the render target to the new created. then made everything you usually do manually but inside the blueprint. this way each one has different targets and are independent. i also did this client side and server side independent, to avoid the lag on client side (and dont depend on recieving network updates for the rendering)
everything is explained on the screenshots. hope its useful.
Also, i used this respawn setup for controlling the asignation of the pawns and set the default pawn class to none. note that the player1 and player2 are arrays of class Player Start, and each player start on the map needs to have their tags (Player1 and Player2)
Hello, thank you for reply!
But unfortunately, that child actor component still not rotating as it should… Static mesh component is ok, but field of view of child actor class - render target is not updating pitch… in this video its better to see what i mean:
that sniper texture is set to "only owner see" so it is not necessary to replicate pitch and yaw, i not tested that replication with pitch but i think it cant help..
I uploaded my main project, if you could check it once more again i will be very thankful
and now material, i have some way how to set material to each connected player, but i totally dont know why its not working, i have that placed in “Hero Base” blueprint, it uses node “get all actors of class” and then set to character unused class and texture… material dont need to be changed because it worked for me, but i cant find way how to avoid overriding classes and textures… if you could help me with this … i spent with this sniper texture 30 hours atm and it still not working…
did you try my blueprint? its step by step and it works
also, see the hierachy on my PlayerCharacter and make sure your static mesh is inside the camera.
you will still need to replicate pitch and yaw, else your clients are gonna aim up or down and the other players wont ever know about it. youll need those values for AimOffset animations. just note that i set 2 “SetRelativeRotation” for FollowCamera by mistake, the last one is not needed.
Hello,
I did it like you, but still without success (im only not sure if i did correctly function set yaw pitch because it is not in your screenshots)… Here is my screenshot:
hi, i got your BP but cant test anything because you have not included files like your game instance for example, and i get bazillions of errors trying to run it. this is my BP, tell me if it works
oh and i finally was able to make it run. so the 2 mistakes are:
look closely at my BPs, you missed the part where i created a new texture render target2d inside the blueprint. that is important, else, they all will use the same target and overlap their own sniping sights.
at your RM1 (i guess thats the material you are using right?) you duplicate the texture, but on blueprint, you are only changing the parameter of 1 which makes no sense at all. in my example i did that because i didnt have 2 parameters in the material, if you want to use that setup you have to change both (tho i dont know why you are using that material setup, just multiply/divide * 2 the texture if you want something like that)