Hi everyone! Today you are going to learn how to send messages to another script/gameobject.
so what you want is to change this variable A from 0 to 1.
So you want to send it to a player transform/gameobj
That is the basics of SendMessage! Thanks for reading. please leave a comment of what tutorial i should do next!
Thx Wooden
so what you want is to change this variable A from 0 to 1.
So you want to send it to a player transform/gameobj
Code:
var playerobj : Transform;
function Start() {
playerobj.SendMessage("WhatCoroutineNameIs",1,SendMessageOptions.DontRequireReciever);
}
2nd Script
var A = 0;
function WhatCoroutineNameIs(mynum : int) {
A += mynum;
}
That is the basics of SendMessage! Thanks for reading. please leave a comment of what tutorial i should do next!
Thx Wooden