mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-23 02:44:36 -05:00
Made the Slime Spawn on Network
- Debuffs don't apply properly yet
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using MLAPI;
|
||||
using MLAPI.Messaging;
|
||||
|
||||
public class Goo : MonoBehaviour
|
||||
{
|
||||
@@ -9,7 +11,7 @@ public class Goo : MonoBehaviour
|
||||
void FixedUpdate() {
|
||||
Lifetime++;
|
||||
if(Lifetime == 850) {
|
||||
Destruction();
|
||||
DespawnMyselfServerRPC();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +24,8 @@ public class Goo : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
void Destruction() {
|
||||
Destroy(gameObject);
|
||||
[ServerRpc(RequireOwnership = false)]
|
||||
private void DespawnMyselfServerRPC() {
|
||||
this.gameObject.GetComponent<NetworkObject>().Despawn(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user