Skip to content

Player spawns at old position for a single frame on clients #3204

@daalen

Description

@daalen

The clients have authority over their own players' transform. When a player dies, I disable the player object, set it to a new spawn position, and after a few seconds activate it again to have the player respawn. The position is set on both the controlling client and the server (rigidbody position too) with the teleport flag on. When interpolation on the networktransforms is off, everything works. When it is on, something weird happens on the clients that do not control the player: when reactivating the gameobject, the player appears where they died for a frame or so, and then is quickly interpolated to the correct spawn position. The server just sees it at the new spawn position like it should.

How can I avoid the player appearing at their old position when reactivating the gameobject? While inactive, it's in the correct (new) position, but somehow it shifts back for a tick when activated.

If I delay reactivating the gameobject on other clients by 0.1 seconds, it all works without this weird effect, but this is an uncomfortable hacky solution to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:supportQuestions or other support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions