hello there,
I have been following a tutorial on how to make a chess game as I want to create a game like chess but add my own twist. When following a specific script I keep getting errors about “IObjectTweener”
Assets\Scripts\Piece.cs(5,26): error CS0246: The type or namespace name ‘IObjectTweener’ could not be found (are you missing a using directive or an assembly reference?)
Here is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(IObjectTweener))]
[RequireComponent(typeof(MaterialSetter))]
public abstract class Piece : MonoBehaviour
{
private MaterialSetter materialSetter;
public Board board { get; set; }
public Vector2Int occupiedSquare { get; set; }
public TeamColour team { get; set; }
public bool hasMoved { get; private set; }
public List<Vector2Int> availableMoves;
private IObjectTweener tweener;
public abstract List<Vector2Int> SelectAvailableSquares();
private void Awake()
{
availableMoves = new List<Vector2Int>();
tweener = GetComponent<Tweener>();
materialSetter = GetComponent<MaterialSetter>();
hasMoved = false;
}
public void SetMaterial(Material material)
{
materialSetter.SetSingleMaterial(material);
}
public bool IsFromSameTeam(Piece piece)
{
return team == piece.teamp;
}
public bool CanMoveTo(Vector2Int coords)
{
return availableMoves.Contains(coords);
}
public virtual void MovePiece(Vector2Int coords)
{
}
protected void TryToAddMove(Vector2Int coords)
{
availableMoves.Add(coords);
}
public void SetData(Vector2Int coords, TeamColour team, Board board)
{
this.team = team;
occupiedSquare = coords;
transform.position = board.CalculatePositionFromCoords(coords);
}
}
the error occurs on line 5 and line 21:
[RequireComponent(typeof(IObjectTweener))]
private IObjectTweener tweener;
any help on this subject would be greatly appreciated, thank you!