Jump to content

More code errors

Jamchuck

So i import this code into unity

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

public class lava : MonoBehaviour
{
    
    void Lava( collision)
    {
        // Check if the collider we hit has a rigidbody
        // Then apply the force
        if (collision.rigidbody)
        {
            Application.Quit();

        }
    }
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        Lava();
        
        
    }
}

 

and it gives me this error  "Assets\lava.cs(9,25): error CS1001: Identifier expected"

 

Link to comment
Share on other sites

Link to post
Share on other sites

admittedly the error description is a bit vague but there are only a couple of words at the line it specifies, you should be able to read your code and see that you forgot the type specifier for "collision".

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×