- Home /
How to change shape from cube to sphere and keep the code
I don't know how to change the shape from a cube to a sphere . Should I add other object and replace the code or I can change the shape of object before the game start ?
Are you trying to just change the 3D model at run time? If so I believe this should answer your question. https://answers.unity.com/questions/556851/change-prefab-3d-model-at-runtime.html
Answer by Marioooo · Dec 31, 2019 at 11:33 PM
You should add more details about the project you're making...
You can use a public Sprite variable and add two sprites... You can change the Sprite addressing the Sprite renderer component and changing the Sprite variable.
Also you can add two colliders and enable only the one you need. Or add one or another in runtime.
Your answer
Follow this Question
Related Questions
DontDestroyOnLoad object 1 Answer
Service not available 0 Answers
CG compiled to GLSL: hyperbolic functions not found. 0 Answers
Advice wanted on state transition code. 2 Answers
Terrain not shown 0 Answers