Gameobject Movement on Text input in Unity3d

This is the on demand tutorail where i will simply show how to control object movement on text input. A user will provide text input in order to control an object movement. Lets get started:


  1. Create a demo scene with a cube and plane.
  2. Create an input field for user input
  3. Create a button 
  4. Create a Text Game object for showing error


Scripting
  1. Create a Script MovementOnText and attach it to your cube. Copy from below, the script is self-explanatory with comments:
  2. Go to you Cube object and Drag n Drop Cube to your on click event of the button and attached GetInputText Method to it and also Assign input filed into its parameter.
  3. Lets play and input commands like Move, Back, left, right, up, down


Post a Comment

0 Comments