x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

I'm making a vehicle configurator. How to change my object visibility using my widget buttons?

I'm making a vehicle configurator. I have a widget menu and that part works fine. What I need to figure out is how to change my object visibility using my widget buttons? I want to be able to click on the Ford button and have the Ford truck appear and the Chevy Truck to dissapear, etc. I am not a programmer, I'm trying to use blueprints to set this up, but I have had no luck. Please Help?!

alt text

Product Version: UE 4.17
Tags:
more ▼

asked Aug 22 '17 at 01:21 PM in Blueprint Scripting

avatar image

sarahk41
1 1 1

avatar image Meda9090 Feb 05 '19 at 10:12 AM

Hello, My name is Medet. I’m a 3D animation specialist from Kazakhstan. I saw your “configurator car” and the other works, I liked it so much, well done. That’s why I want to study work like you. Can you send me “configurator project” for study, please. I want to learn it and work in this direction. Thank you. with best regards. Nurgojaev Medet. My email: meda9090@mail.ru

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

To toggle the mesh visibility, I added a function to the base class for the child blueprints to flip the mesh visibility.

alt text

In your UI, retrieve the current vehicle your using, cast to the base class, and toggle the visibility.

meshvisiblity.png (101.9 kB)
more ▼

answered Aug 22 '17 at 02:01 PM

avatar image

cmarston74
296 6 7 10

avatar image sarahk41 Aug 25 '17 at 06:59 PM

Thank you for your quick reply! I really appreciate it. I have set up the vehicle blueprint just like it is above, but there must be something wrong with my widget blueprint, I click my widget button and nothing happens. I'm still new at blueprints. Any ideas?

alt text

screenshot-33.png (522.4 kB)
avatar image cmarston74 Aug 25 '17 at 08:19 PM

The set node should be a get node. Delete it, drag out your variable while holding ctrl and then hook it up. Add a printstring to the cast failed pin also to determine if your cast is failing.

avatar image sarahk41 Aug 25 '17 at 08:50 PM

It is still not working. :(. Here are the screen shots for both blueprints. alt text

screenshot-35.png (507.7 kB)
screenshot-34.png (531.8 kB)
avatar image cmarston74 Aug 25 '17 at 10:05 PM

Your checkboxes are backwards. If the branch is true you want to have the SetVisibility to false. And if the branch false, you want to set it to true.

And after your cast remove the failed from the ToggleVisibility pin, if you pass a bad reference on accident this will cause a crash.

avatar image sarahk41 Aug 30 '17 at 09:08 PM

Thank you for your help. Unfortunately, it still doesn't work. I may have to look into doing interactive 3D widgets or something. I've tried so many different blueprints to try to get this to work including the one you provided and nothing seems to work. It looks like I may have to approach it differently.

avatar image cmarston74 Aug 30 '17 at 09:53 PM

When I get home this evening, I'll put together a small project that does what your trying to do and you can take a look at it. You can get this working.

avatar image sarahk41 Aug 30 '17 at 10:04 PM

You are awesome! Thank you so much for trying to help me figure this out. I know it must be something simple I'm missing. It shouldn't be this hard for me to get it to work. I really do appreciate it.

avatar image cmarston74 Aug 31 '17 at 01:04 AM

You're welcome. And yeah, unfortunately even after 30 years programming, we all sti.get something difficult. I won't lie to you about that. You just kinda learn to accept it as part of the joy when you accomplish the task.

But which engine are you using so I make it in the right one?

avatar image sarahk41 Aug 31 '17 at 01:13 AM

I'm using version 4.17.1

avatar image cmarston74 Aug 31 '17 at 02:43 AM

Sorry, I already made it in 16.3

It should be the same regardless of version. It's uploading to my Dropbox now. As soon as it is up, I'll send the link so you can pull it.

avatar image cmarston74 Aug 31 '17 at 02:51 AM

https://www.dropbox.com/s/uw01uxtz7o2o8zr/HideMesh.zip?dl=0

This is the whole project.

I created a base actor class with a skeletal mesh component and then three children, one for each mesh.

In the level blueprint, I spawned one actor of each. I then created a set of functions to set visibility on each mesh individually and as a group. In the game mode blueprint (gmMain) I created event dispatchers to carry the UMG clicks to the level blueprint to show and hide each mesh when you click a button in the HUD.

Hopefully this helps to get you going. If not, feel free to ask.

avatar image sarahk41 Aug 31 '17 at 05:06 AM

Thank you very much! I have received the project and I will take a closer look at it tomorrow evening after work and see if I can get it to work with mine. I'll let you know how it goes.

avatar image sarahk41 Sep 01 '17 at 08:56 PM

So, when I open your project and preview it, nothing works and the widget doesn't show. I'm wondering if it is the version of UE4 that I am using. I'm going to try an earlier version and see if that is the issue.

avatar image sarahk41 Sep 02 '17 at 12:52 AM

I finally got it working! Thank you so much again for all of your help!

avatar image cmarston74 Sep 02 '17 at 01:32 AM

Congratulations! Glad I could help. Wishing you the best in your journeys.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question