Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    100

    2D Unity 4.5 buzzsaw_020_points_2 Multiple Base class error

    Hello, I'm getting a multiple Base class error. My public Class PointStar looks like the tutorial.

    Assets/Scripts/PointStar.cs(3,41): error CS1721: `PointStar': Classes cannot have multiple base classes (`UnityEngine.MonoBehaviour' and `IPlayerRespawnListener')
    Click image for larger version. 

Name:	error.png 
Views:	393 
Size:	179.1 KB 
ID:	74346


    Code:
    using UnityEngine;
    
    public class PointStar : MonoBehaviour, IPlayerRespawnListener
    {
    	public GameObject Effect;
    	public int PointsToAdd = 10;
    
    	public void OnTriggerEnter2D(Collider2D other)
    	{
    		if (other.GetComponent<Player>() == null)
    			return;
    
    		GameManager.Instance.AddPoints(PointsToAdd);
    		Instantiate(Effect, transform.position, transform.rotation);
    
    		gameObject.SetActive(false);
    	}
    
    	public void OnPlayerRespawnInThisCheckpoint(Checkpoint checkpoint, Player player)
    	{
    		gameObject.SetActive(true);
    	}
    }

  2. #2
    Join Date
    Mar 2004
    Location
    Anacortes, WA
    Posts
    4,168
    What does the IPlayerRespawnListener file look like?
    Need any help? Feel free to PM me - or send an email directly to nelson@3dbuzz.com!

  3. #3
    Join Date
    Sep 2003
    Posts
    100
    Found it, thanks again, Nelson. I had public class IPlayerRespawnListener

    I should have had public interface IPlayerRespawnListener

    It works now. This course if very exciting!
    Last edited by hotsauce; 11-14-2014 at 12:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •