Quantcast
Channel: Answers for "How to convert a float to a string and then have it appear in a gui rect"
Viewing all articles
Browse latest Browse all 6

Answer by unaimed

$
0
0
using UnityEngine; using System.Collections; public class *NAMEOFSCRIPT* : MonoBehaviour { public string horSpeed; public PlayerMovement pm; void Start () { horSpeed = pm.horAcceleration.ToString(); } void OnGUI(){ GUI.Box (new Rect (Screen.width - 100, Screen.height - 50, 100, 50), horSpeed); } } this is c# but try it, attach the right script (if needed), change *NAMEOFSCRIPT* to the name of the c# script

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images