Renderer & Physics = false does not work?

Hi I’ve started and didn’t seem to find out what was wrong. This script is assigned to the cube that is supposed to drop on the player but it doesn’t set the material to false or physics. It just falls normally instantly, I feel like I’ve copied line by line but maybe I’ve missed a critical step? Bashing my head against a wall here :slight_smile: any help is appreciated, thanks!

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

public class Dropper : MonoBehaviour

{
MeshRenderer renderer;
Rigidbody rigidbody;
[SerializeField] float Droptimer = 3f;

void start()
{
    renderer = GetComponent<MeshRenderer>();
    rigidbody = GetComponent<Rigidbody>();

    renderer.enabled = false;
    rigidbody.useGravity = false;
}

}

Try doing it in Awake() and report back.

try this:

void Awake()
{
    renderer = GetComponent<MeshRenderer>();
    rigidbody = GetComponent<Rigidbody>();
}

void Start()
{
    renderer.enabled = false;
    rigidbody.useGravity = false;
}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms