playMaker

Author Topic: how do I create dynamic text (input field) on 3D object?  (Read 2836 times)

anton88pro

  • Playmaker Newbie
  • *
  • Posts: 2
how do I create dynamic text (input field) on 3D object?
« on: October 02, 2017, 11:14:13 AM »
Hello!

In my adventure game I want a player to figure out and type a password using intercom (doorphone) to enter a building. Ideally I want the intercom to be a 3d model with animated bottoms and pushing buttons would display numbers on intercom's screen. So how do I do it?
I know how to use 2d UI, input field and related Playmaker actions, but I don't how to do input 2D text on 3D object.
My own alternative solutions would be:
1. to use pre-rendered image of 3D object and just do 2d UI.
2. use 3D model but without screen.

P.S.:I'm sorry if this question was already asked before. I'm new to Unity, Playmaker and this forum.

Deek

  • Full Member
  • ***
  • Posts: 133
Re: how do I create dynamic text (input field) on 3D object?
« Reply #1 on: October 02, 2017, 02:53:06 PM »
The only way to use Text in 3D space independent of your camera's position is a Text Mesh (create new GameObject, Add Component>Text Mesh).
The text will likely be blurry, therefore you have to decrease the character size (e.g. to 0.3) and increase the Font Size (e.g. to 500). After that you can still manipulate the scale of the GameObject to the size you want.
Align as mush Text Meshes as you need before your intercom model, give them colliders the size of their appearance, set them to be a trigger and raycast from your current mouse position in positive Z direction when clicking and check if the raycast hit any of those Text Meshes.

Since Text Meshes are fairly limited option-wise or because you might want to use a 2D UI solution you could also constantly check with a raycast if your Main Camera is near the intercom and if so, enable a custom keypad on your UI (you might need an extra camera for that).

As your question isn't specifically PlayMaker related, you'll probably find more and maybe more helpful answers in the official Unity forum or the answer-section (http://answers.unity3d.com/index.html).

anton88pro

  • Playmaker Newbie
  • *
  • Posts: 2
Re: how do I create dynamic text (input field) on 3D object?
« Reply #2 on: October 03, 2017, 12:10:02 PM »
thanks a lot, I'll try it out