I have two movement scripts on the player and need to switch between them while in game
here is the code i copied and trid to mod
but get this the error . i dont understand what this means
Assets/SwitchFlyLand.cs(28,48): error CS1061: Type UnityEngine.Component' does not contain a definition for
Enabled’ and no extension method Enabled' of type
UnityEngine.Component’ could be found (are you missing a using directive or an assembly reference?)
using UnityEngine;
using System.Collections;
public class SwitchFlyLand : MonoBehaviour
{
public Component eagleFlying;
public Component characterMotor;
void Start()
{
eagleFlying = GetComponent<EagleFlying>();
characterMotor = GetComponent<CharacterMotor>();
}
void Update()
{
if(Input.GetButtonDown("Fly"))
{
eagleFlying.Enabled = true;
characterMotor.Enabled = false;
}
else
{
if(Input.GetButtonDown("Land"))
{
eagleFlying.Enabled = false;
characterMotor.Enabled = true;
}
}
}
}