I have 2 Standard Asset First Person Controllers in my game, lets name them FPC1 and FPC2, between which I can switch. While one is being used by the player, the other is controlled by an AI script.
-While I’m controlling FPC1, I disable the Character Controller and the First Person Controller script of FPC2, but I enable the AI script on FPC2.
-When I switch to FPC2, I disable Character Controller and First Person Controller of FPC1, I enable Character Controller and First Person Controller of FPC2, I disable AI script of FPC2 and I enable AI script of FPC1.
The problem is that one of the behaviours of the AI script doesn’t work well. While I control FPC1 I want FPC2 to look at me (FPC1), so I use LookAt(FPC1) method. It looks at me fine except for the X Axis. The X axis doesn’t update in the LookAT(), instead, it keeps the value of the FPC just before being switched.
For example, I’m controlling FPC1, and I look to the floor while doing it. Then, when I switch to FPC2, FPC1 looks at me regarding Y and Z axis, but it keeps looking at the floor.
It seems that something in First Person Controller script is keeping those values and won’t let them update. Anyone can help me? Thank you in advance.