atm i am doing
npc.transform.position = player.transform.position;
but the npc will just glide along the map to my position lol
Solved Teleporting an NPC?
Discussion in 'Rust Development' started by ownprox, Nov 11, 2015.
-
Destroy it then recreate it
-
-
Calytic Community Admin Community Mod
Rust has client-side bounce mitigation which is meant to prevent player models from visibly hopping around the world as they desync/resync due to latency or network lag. It is probably not possible to disable this given that HumanNPC hijacks the BasePlayer class client-side.
There are two possible solutions that come to mind.
1) Drop the NPC under the map, "teleport" them under their destination, then elevate them back to the terrain at their destination. This would probably require some modification of HumanNPC as HumanPlayers will constantly check for the closest ground vector and teleport to it. This ground check (GetGroundY) would have to be temporarily disabled for this to work.
2) Despawn and respawn the NPC at their destination. This may cause more load on the server, as the npcs would have to reinitialized completely when teleported.