Skip to content

Activate/Deactivate laser pointer when gameobject.setactive(true/false) #9

@SpaceHuskyZero

Description

@SpaceHuskyZero

Love this pointer but I'm looking for a way to deactivate it when the GUI is disabled. I've tried to do it myself but can't seem to get it to work. I've tried deactivating the scripts, the pointer objects, etc but nothing works. I am VERY new to Unity and coding so it's no surprise that I can't figure it out on my own. Would love for you guys to help solve this!

Just attempted the following under protected virtual void in IUILaserPointer:
if(GUICanvas == true)
{
laserPointer.enabled = true;
}
else if(GUICanvas == false)
{
laserPointer.enabled = false;
}

Just got a NullReferenceException error. No idea how to fix that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions