- Home /
How can i enable a Gameobject with an animation event?
Hello i need a script to enable a gameobject with an animation event. please help that would be great!
Answer by SergioSandiaz · Sep 19, 2016 at 06:00 AM
public GameObject Object;
void SetOn() {
Object.SetActive(true);
}
the you call it from the animation event
A parsing error usually occurs when you forget a "{}" or sometimes ";"
it says that the last } is wrong or something.
So, you need to check wich "{}" is wrong, on monodevelop click "Build" ins$$anonymous$$d of just save, this will show you all the compiler errors
can you please send me a full c# script? that would be amazing
if you would help me that would be amazing :) i need a full script for enable a object pls because otherwise it shows parsing error
Well bro, that´s basic program$$anonymous$$g I think
public class SetOn : $$anonymous$$onoBehavior {
public GameObject ObjectToActive;
void SetOn () {
ObjectToActive.SetActive(true/false);
}
}
Your answer
Follow this Question
Related Questions
deactivate script for time period when script is used 0 Answers
How to disable halo when it is already enabled via script C# 0 Answers
c# How Do I disable current script or anyother script in the program within code? 2 Answers
Is there a way to copy animation events between Mecanim animations? 2 Answers
How can you check for player input during specific frames of an animation? 1 Answer