Closed Iriemonkey closed 4 years ago
Hello,
Search around for how to move objects in Unity, then you can put that code inside of the methods that Ardity is executing.
For example, if you follow this guide try putting the following code inside of the method OnMessageArrived
:
transform.Translate(Vector3.forward * Time.deltaTime);
Moreover, that parameter msg
you see in the method OnMessageArrived
can be used to move the object in different directions, just add an if
and depending what the msg
contains you can do:
transform.Translate(Vector3.forward * Time.deltaTime);
or:
transform.Translate(Vector3.back * Time.deltaTime);
Regards.
Hello,
i am fairly new to working with Arduino and Unity, and i don't really understand how i can use the input from the Arduino to control "stuff" ( movement of a Game Object for example ). I can print messages to the console in Unity by pressing a pushbutton on an Arduino circuit, but how do i use these messages to trigger something? (" e.g. save the value to a variable and move a cube, when the value is "1" .... i hope you get the point :/ )
Thank you in advance! kind regards, Tobi