Unity Scripting Tutorial : Call C# Script from GameObject

preview_player
Показать описание
In this Unity 2018 tutorial I show how to call a method of a C# script (Monobehavior) from anoather game object's script.

As an example I use the game object that we created with Blender 2.8 that has a blue material assigned.

I will add a script to this object with a method called ChangeColor that we call from a second script that is attached to another game object.

I call this when the other game object (a sphere) collides with the floor.

See my social profiles here

Рекомендации по теме
Комментарии
Автор

Very nice tutorial! What would an alternative method be where you dont need to drag anything into the script as a gameobject reference? If your game has more objects that you need to reference it can get very annoying when you have to drag and drop 100+ different references.

ifuturestudio
Автор

Thats a nice code editor, is that part of Unity or is it standalone application?

RomboutVersluijs
welcome to shbcf.ru