- Home /
Spawning an object with entering a trigger.
I'm really new to scripting, so please be detailed with your answers.
I'm trying to spawn (or make visible) an object with children by entering a trigger. Reason being that the object is heavy for the pc when it's getting rendered. So I'd like to have an invisible box that activates the rendering of my "object group" that has lots of children or meshes.
Looks like you're pretty new around here. That's way too little to go on in order to answer. Fortunately there are lots of places to learn Unity try the Learn button at the top of the page or go on YouTube. I understand telling someone who know's nothing about Unity to go a learn is like telling a dyslexic to look something up in a dictionary but you already know you want to spawn something. As a heads up try looking up some of these commands:
GameObject newItem = Instantiate(itemPrefab) as GameObject;
OnTriggerEnter()
gameObject.SetActive(false);
gameObject.SetActive(true);
Google and YouTube are really good tools and you'll be amazed how much stuff is out there similar to what you're looking for.
Once you've got a better idea of what you're come back and show us what you're trying if you're getting stuck.
Your answer
Follow this Question
Related Questions
Random spawn of object on trigger 3 Answers
Trigger sound on another gameobject 1 Answer
Spawning if there is space 1 Answer