Remember me
You are here: HomeForumCyberix3D ForumGeneral Discussion
Welcome, Guest
Username: Password: Remember me

TOPIC: Variable in text input

Variable in text input 4 years 4 months ago #1820

  • kel5isgod
  • kel5isgod's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 1
Hello all. I have a 2DModel, a text input, and I want some math to show in it. However when i put in my math, ( math.sqrt(math.pow(car1.linearVelocityX, 2) + math.pow(car1.linearVelocityY, 2)) ), it simply shows the whole string. How can I make it show the output of this instead of the entire thing? Attached is the code, and what is displayed.
Code:
Screenshot2019-11-27at7.53.41AM.png


Displayed:
Screenshot2019-11-27at7.55.06AM.png
The administrator has disabled public write access.

Variable in text input 4 years 4 months ago #1822

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 661
  • Thank you received: 628
Hello,
You need to separate the two equations to tow variables and then combine them and set the text.
You also need to measure the vehicle object instead of the car body model.

math_to_input.png


Here is an example:
www.gamemaker3d.com/player?pid=01649797

Regards,
Cyberix3D team .
The administrator has disabled public write access.

Variable in text input 4 years 4 months ago #1823

Thanks. What unit is velocity measured in? Meters/sec?
The administrator has disabled public write access.
Time to create page: 0.176 seconds