I can’t get rid of this error, i’ve tried changing the typing of the variables and typecasting(this is my first time using unity), can anyone help?
here’s the code:
using System.Collections;
using System.Collections.Generic;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.UI;
public class WindControlUI : NetworkBehaviour
{
public WindActivation windActivation; // Reference to the WindActivation script
public void ToggleWind()
{
if (IsOwner)
{
bool isActive = windActivation.windActive.Value; // Access the .Value property
CmdSetWindActive(!isActive); // Toggle the value and send it to the server
}
}
[ServerRpc]
private void CmdSetWindActive(bool active)
{
windActivation.windActive.Value = active; // Set the network variable's value
}
}