Hello
I know it can be strange to create a topic because I have no error but…
When I add after monobehavior the IInteractable in the InteractSphere script, VisualStudio code doesn’t detect any problem even if I haven’t an Interact Function in my script.
Lol for a once I have problem it’s a problem
My sphereIntaractable script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InteractableSphere : MonoBehaviour,IInteractable
{
[SerializeField] private Material greenMaterial;
[SerializeField] private Material redMaterial;
[SerializeField] private MeshRenderer meshRenderer;
private bool IsGreen;
private void SetGreenColor()
{
IsGreen=true;
meshRenderer.material = greenMaterial;
}
private void SetRedColor()
{
IsGreen=false;
meshRenderer.material = redMaterial;
}
// Start is called before the first frame update
void Start()
{
SetRedColor();
}
}
and my IInteractable script:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public interface IInteractable
{
void Interact (Action onInteractionComplete)
{
}
}
Good Luck
François