Download

[HELP] To get the concept behind smartphone in a game

Hello community,

I want to create a smartphone in my game where you could use it to chat players, get information about your character, see the map, and use it as a flashlight. I understand that I need a model for the phone and let’s say I have it. So do I get this right?

#1. The smartphone is a static mesh that is let’s say attached to a socket in the hand when equipped.
#2. The player controls the phone with mouse moving the character’s finger.

What I really wonder is: How to make it change the display? Like when you click on the “messanger” app, the messanger app shows up on the screen and you choose people to chat up? Or how would I show the map on the screen? Render to Texture maybe? If it’s RTT then how do I implement it?

Above all, is it even possible to make a messanger for the phone in the game? :smiley:

Because I was thinking of changing the texture of the phone whenever you click. But if I take the messanger into account then it would be impossible to do it with textures. So do you have any ideas? Or is there even tutorial on how to make it? Cuz I’ve seen it in games but never seen tutorial. Tried googling but didn’t found anything…

PS. Sorry for my english :smiley:

It’s best to use Slate or UMG with a RenderTexture or UMG’s 3D component-based widget for this sort of thing and slap it on the phone’s screen. You would just animate the menus in/out, remove from parent, add to viewport, it’s fairly straightforward stuff. 3D widget would probably be easiest since it uses UMG (which is crazytown banana pants simple) and allows for mouse interaction out of the box.

Though I feel like your idea of moving the thumb with the mouse is a bit expensive and wholly difficult without finger IK. Cool, but maybe impractical.

Either way you can see a mini-essay I did on in-game cellulars (which may or may not be helpful for you) here: https://forums.unrealengine.com/showthread.php?50267-Creating-in-game-cellphone-with-menus&p=168966&viewfull=1#post168966

You can see a demonstration of the 3D widget system here: https://www.youtube.com/watch?v=dsrZgmv23Yc&list=UUBobmJyzsJ6Ll7UbfhI4iwQ

I think I got it…

So I create a new Blueprint in UE4 and create a component for StaticMesh (for the phone model) and component for the widget right? And I just code my widget to do what I want. Well if it’s that it’s pretty easy thing to do, but what I wonder is, can I pass C++ variables to the 3d widget? I mean… If I make the messaging system through the phone, can I get all the message history from database and output it in the widget? That would mean getting data from DB with C++ and passing it to Blueprint. Is that possible?

Yes, absolutely. Just like you can communicate with BP classes through C++, you can communicate with widget BPs. You can also create c++ function nodes and use them in your widget graph to get info to display.

Great, but in my 4.6 version I can only create a new Widget Blueprint or Gadget. How do I make a 3D widget? Or have I misunderstood something? Just checked on wiki there’s even done tutorial on how to use C++ vars :smiley: thanks, I’ll begin my work today.

The 3D widget is a component of a 3D actor. You create a UMG widget like normal then add a widget component to your actor and choose the UMG widget you created before as the widget to project. It’s all outlined in the video I posted earlier :slight_smile: