Hey everyone, I’d really appreciate some help with a doubt I’ve got. I’ve got a revive mechanic in a game I’m making (as part of my class; I’m a student), which works the following way:
Consider that character (C) is dying, and character (R) is going to revive it.
Before C dies, its class and transform are shared with R.
When C dies, it is deleted from the game.
When R uses the revive mechanic, a new C is spawned using the class and transform R has stored with it.
The problem I currently have is that the forward vector of the new C is always (1,0,0), whereas the old C died with a different forward vector. What do you guys think could be the problem?
Since the transforms match at the time of spawn operation, the rotation values should be going through. Right after spawn, do you see it rotating towards the x-axis, like maybe for an instant?
Oh and btw if your character is facing in the correct direction, but it’s just the Control Rotation node giving incorrect results, it’s probably got to do with the AI Controller not having finished initialization. You can see the correct results by setting a small delay after Event Begin Play for your AI Controller. So if that is what’s causing the issue, I’d suggest using the pawn’s Get Actor Rotation instead of Control Rotation.
Hi again. I don’t have AI Controllers in my game since I haven’t been taught how to use them and it’s a tight schedule. All my characters work based on their event graph. I did try using the Actor Rotation instead of Control Rotation but that didn’t work either.