I have tried for the past day or so to see if i could find something to get this to update every time the position change happened, but i just can't figure it out. It updates not going to say randomly, but certainly not in a way i can tell of a pattern
video -> https://files.catbox.moe/e79o7n.mp4
Code:[ChatCommand("test")] void cmdTest(BasePlayer player, string cmd, string[] args) { Vector3 pos =StartPos; Quaternion angles = new Quaternion (0,0,0,0); GameObject prefab = GameManager.server.CreatePrefab("assets/prefabs/building core/floor/floor.prefab", pos, angles, true); BuildingBlock block = prefab.GetComponent<BuildingBlock>(); block.transform.position = pos; block.transform.rotation = angles; block.gameObject.SetActive(true); block.grounded=true; block.blockDefinition = PrefabAttribute.server.Find<Construction>(block.prefabID); block.Spawn(true); block.SetGrade(BuildingGrade.Enum.Twigs); block.health = 10f; block.SendNetworkUpdate(BasePlayer.NetworkQueue.Update); Effect.server.Run("assets/bundled/prefabs/fx/smoke_signal_full.prefab", block, 0, Vector3.zero, Vector3.zero, null, true); Move(block,player,pos); } void Move(BaseEntity entity,BasePlayer player, Vector3 pos) { if(entity==null)return; Vector3 pos2=pos+new Vector3(0,0.1f,0); entity.transform.position = new Vector3(entity.transform.position.x,entity.transform.position.y+1,entity.transform.position.z); entity.SendNetworkUpdate(BasePlayer.NetworkQueue.UpdateDistance); entity.SendNetworkUpdate(BasePlayer.NetworkQueue.Update); timer.Once(1f, () => { Move(entity,player,pos2); }); }
Updating a transform position
Discussion in 'Rust Development' started by ツンデレラ, Apr 8, 2016.
-
Have you tried walking on them? I found that when moving building parts up/down collider batching would make it look like its in the same position but when you walk on it its actually not. My solution was to destroy the block and spawn a new one
-
I did ,but it does the same thing and just update what seems like at random.
