Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions testproject/Assets/Tests/Manual/Scripts/RandomMovement.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
using UnityEngine;
using MLAPI;

namespace TestProject.ManualTests
{
/// <summary>
/// Used with GenericObjects to randomly move them around
/// </summary>
public class RandomMovement : MonoBehaviour, IPlayerMovement
public class RandomMovement : NetworkBehaviour, IPlayerMovement
{
private Vector3 m_Direction;
private Rigidbody m_Rigidbody;

public void Start()

public override void NetworkStart()
{
m_Rigidbody = GetComponent<Rigidbody>();
ChangeDirection(true, true);
if (NetworkObject != null && m_Rigidbody != null)
{
m_Rigidbody.isKinematic = !NetworkObject.IsOwner;
if (!m_Rigidbody.isKinematic)
{
ChangeDirection(true, true);
}
}
}

public void Move(int speed)
Expand Down