Download

How do I interactively view and spin models in game?

Hello,

I have been trying to create an interactive store environment for over a year now. I am trying to make the items on the shelves viewable and rotatable via mouse input, but keep falling short on the execution of it.

My final goal is to have products on a shelf. When these products are clicked, an interactive version of that model appears or fades in in front of the character and is spinnable and zoomable if possible. My previous similar post from awhile ago is dead now and didn’t really get anywhere, unfortunately.

Previous post - https://forums.unrealengine.com/showthread.php?62061-Creating-an-in-game-model-viewer

The two methods that have gotten me closest are:

  1. Doing a line trace on the object and moving it to the location in front of the player, stopping player movement, and changing mouse input to rotate the product - https://youtu.be/7geLwi3A6u8

  2. Viewing the object on the HUD with a widget using a 2dSceneCapture Texture outside the level - https://youtu.be/UccUJLDPViw
    I used this forum post as a guide, which helped immensely - https://forums.unrealengine.com/showthread.php?84416-Tutorial-Live-3D-Content-in-your-HUD-or-UI

Pros:

  1. Using the first method the model looks great when spinning it around.

  2. Using the second method, the lighting can be adjusted for the model only, creating more of a light studio. Also, the model is on the HUD so it can’t go through any of the other objects in the level.

Cons:

  1. The problems I’m having with the first method is that the lighting on the product cannot be controlled. It is simply the lighting in that room which lights the product. Also, if close enough when “picking up” the product, it has a chance of clipping through the shelf it sits on because it’s in the same model space.

  2. The problem with the 2dSceneCaptureTexture, first of all, is the quality of the model. If you notice in the video the aliasing is absolutely terrible and is affecting the quality and “wobbliness” of the texture on the model when it spins. Also, some models I tried have an opacity issue when rotating.

I tried to contact someone at Lilith Ltd. who worked on Allison Road because they have an amazing setup in their game, which is almost exactly what I would like to accomplish. This is what I’m talking about - https://youtu.be/__i_LoRKhJ0?t=1m30s

No one from Lilith Ltd. ever got back to me, but if anybody has any ideas on how this can be achieved or if there are any newer methods that I might not know about, please let me know! I appreciate any help I can get as this is a necessity for my project. Please let me know if I need to share any more info or take any screenshots. Thank you!

That is more simple:

1.- Put an arrow inside of Player Blueprint (Evict Trace or another somethings) to move the selected object
2.- Into the level blueprint, get objects to interact.
3.- Begin Play -> Save Objects Transform.
4.- When click in player blueprint (set boolean), in level blueprint Set New Object Transform Cast Player->(GetArrowTransform)
5.- Rotate or anything.
6.- Return object to old Transform (Set Actor Transform)

To simulate https://youtu.be/__i_LoRKhJ0?t=1m30s
3.- Simple store saved Z, and maintain X and Y modified when selected

Enjoy!

Thanks for the reply! I will give this process a shot today and will post any results or other questions I might have. I really appreciate it!

You can also turn on/off lights during the whole process that will assist in the lighting situation. Just set up some direct lights in the area you want them to shine when you have an object being interacted with. Turn the lights on when the interaction is happening and turn them off when you are done. Give them a small scope so that the effect is not really noticeable on the environment as well.

That’s a good idea, I will look into building some sort of light rig for my products that only turns on when they are rotatable. Is there a way to have the light rig only cast light on the interactive model and ignore the rest of the environment? Thanks!

I ended up fixing the quality issue I was having with the SceneCapture2D. I was working in Unreal Engine 4.7 and using a Material Domain → Surface. That was looking pretty terrible. I updated to the latest version 4.11.2 and converted my project over to that. There was a material update sometime since 4.7 that added a new Material Domain → User Interface. The model and texture quality were improved GREATLY with this new material type. In my opinion, this is the best method to adding 3d objects to UMG Widgets until Epic adds native support.

If anyone else is interested in something similar to this, there is another very useful tutorial for creating a Skyrim-like inventory system with a model viewer built into it’s menu.