mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
General changes
1. Added tetzlaff ui changes (code may need to be shortened)
This commit is contained in:
26
Assets/Scripts/PlayerScripts/PlayerIndicator.cs
Normal file
26
Assets/Scripts/PlayerScripts/PlayerIndicator.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using MLAPI;
|
||||
|
||||
public class PlayerIndicator : NetworkBehaviour
|
||||
{
|
||||
public GameObject player;
|
||||
|
||||
private Vector3 offset;
|
||||
private Vector3 rad;
|
||||
|
||||
void Start()
|
||||
{
|
||||
rad = (transform.position - player.transform.position);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (!IsLocalPlayer) { return; }
|
||||
|
||||
offset = transform.parent.forward * rad.magnitude;
|
||||
transform.position = new Vector3((player.transform.position.x - offset.x), ((player.transform.position.y - offset.y)), (player.transform.position.z - offset.z));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user