Need to get boolean variable from player character. It seem to work fine when you play as character, but after getting possessed by car, HUD can’t get this variable. Anyone know a work around?
ThirdPersonCharacter is the Actor, NOT the PlayerController.
While you are inside the car, your Actor is “Car”, not “ThirdPersonCharacter”.
If the variable is really inside the character, then move it to PlayerState. This object is made for storing data which belongs to a player (in constrast to the Actor, which is only the player’s current appearance).
You probably thought that the player plays as an “ThirdPersonCharacter” which enters the car.
But the player plays as ThirdPersonCharacter and then plays as a Car upon entering the car! The ThirdPersonCharacter has no association to the player anymore and if done properly, the ThirdPersonCharacter is hidden or even destroyed upon entering the car. When you leave the car, a new ThirdPersonCharacter appears or the old one is moved and made visible again.
What do you mean by PlayerStats ? Is this made by Blackboard Data or i don’t know about something?
Woops, typo, PlayerState is the name. It’s a variable of Pawn, it’s replicated and you can set the PlayerState’s blueprint inside your GameMode. The PlayerState belongs to your player and is always present, even when you change your Actor.
i’ve done the setup and variable is getting stored, but i can’t call PlayerState from HUD. What input i need to give it in the HUD ?
ok. i found how :3