How to show/hide a character in unity

时间:2017-08-05 11:30:03

标签: c# character game-physics unityscript unity2d

I am thinking about a 2d endless runner game with a few choice of character. In my game I will place all characters but they will be deactivated by default.

I want to give a menu to choose which character player like to play with. When player will select a character that specific character will be activated to play.

I don't have any script yet. As I don't how to handle these things

2 个答案:

答案 0 :(得分:0)

As I worked with Unity I have acknowledged that the change of states of a certain object when the game is running is accessed by the script attached to it.

答案 1 :(得分:0)

您需要一个脚本,但它应该是C#中gameObject.SetActive(false)的单行调用

此处的文档和示例:https://docs.unity3d.com/ScriptReference/GameObject.SetActive.html