Hi,
In my game, I am currently coming across an issue every so often when trying to teleport my dead character to the start of the level. I'm using the Opsive 3rd-person controller. My character is using Update instead of Fixed Update on the Ultimate Character Locomotion. Game is locked to 60 FPS.
I first respawn my character. Then to teleport my character, I reset the rotation and position. Not sure if fully required, but I thought it was needed to reset the values when starting over the scenario again. Then I'm setting the position and rotation according to the Opsive docs.
Here is the code I'm using:
The problem I'm getting is that every so often when teleporting my character, my character will appear somewhere slightly random after teleporting. It seems like the character doesn't quite make it to the original start position (which is cached at the start of the script). Sometimes I've seen the character get stuck inside other 3D objects, outside level bounds, etc. Generally, the character is pretty close to the start position. Somewhere within about 10 world units, I would say. It appears like the character isn't teleporting, but rather moving very fast to the original start position. If this is the case, is it possible the character is sometimes colliding with other objects in the scene preventing it from moving as expected?
Because teleporting isn't consistently teleporting to the start position every time it is breaking the game when it occurs. It is very hard to replicate the issue consistently, but it seems like it might occur more often when there are big changes in FPS in the game.
I was curious if there was something I was doing wrong. Or if there was something else I should try doing to ensure this issue does not occur.
Thanks!
-Kirt
In my game, I am currently coming across an issue every so often when trying to teleport my dead character to the start of the level. I'm using the Opsive 3rd-person controller. My character is using Update instead of Fixed Update on the Ultimate Character Locomotion. Game is locked to 60 FPS.
I first respawn my character. Then to teleport my character, I reset the rotation and position. Not sure if fully required, but I thought it was needed to reset the values when starting over the scenario again. Then I'm setting the position and rotation according to the Opsive docs.
Here is the code I'm using:
C#:
_charRespawner.Respawn();
_ultimateCharacterLocomotion.ResetRotationPosition();
_ultimateCharacterLocomotion.SetPositionAndRotation(Position, Rotation, _snapAnimator, _stopAllAbilities);
The problem I'm getting is that every so often when teleporting my character, my character will appear somewhere slightly random after teleporting. It seems like the character doesn't quite make it to the original start position (which is cached at the start of the script). Sometimes I've seen the character get stuck inside other 3D objects, outside level bounds, etc. Generally, the character is pretty close to the start position. Somewhere within about 10 world units, I would say. It appears like the character isn't teleporting, but rather moving very fast to the original start position. If this is the case, is it possible the character is sometimes colliding with other objects in the scene preventing it from moving as expected?
Because teleporting isn't consistently teleporting to the start position every time it is breaking the game when it occurs. It is very hard to replicate the issue consistently, but it seems like it might occur more often when there are big changes in FPS in the game.
I was curious if there was something I was doing wrong. Or if there was something else I should try doing to ensure this issue does not occur.
Thanks!
-Kirt