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"

[Help on]: Problem in Interactive Material Swap!

alt text

I'm trying to do interactive material swap option for my demo project. i used "On Begin Cursor (mesh)" to set or change material. so i made those meshes as hidden and made it visible on clicking the main mesh on which the material need to be changed. i also tried to make this possible but the problem is when i hover over those hidden objects location the material keeps changing. i need to change the material only when the object is visible. i tried these blueprint method myself. i'm very new to this blueprint. can you please find the error/wrong process on my method.

alt text alt text alt text alt text

Product Version: UE 4.21
1.jpg (66.3 kB)
2.jpg (78.5 kB)
3.jpg (99.0 kB)
4.jpg (97.0 kB)
demo-gif4.gif (4.8 MB)
more ▼

asked Nov 20 '18 at 04:54 PM in Blueprint Scripting

avatar image

Anand Kumar
3 1 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Though it might seem counter-intuitive, changing a static mesh's visibility does not automatically change its collision behavior. In other words, just because an object becomes invisible does not mean it automatically stops colliding with other objects or stops interacting with trace tests such as those used by OnBeginCursorOver() to determine whether your cursor is hovering over your mesh.

One way to accomplish what you want to do is to toggle the collision properties of your sphere mesh components along with their visibility so they ignore trace tests while hidden.

To do this, try making a blueprint function (call it ToggleCollision or something) that changes the collision profile for each of your sphere mesh components by using the Set Collision Profile Name node. You can use the profile name "NoCollision" to disable cursor interaction, and the "BlockAll" profile to re-enable cursor interaction. (You may also want to create a new boolean variable to make it easy to know which state you're in, and which to toggle to next.)

As an alternative to all that, and more simply, you can try using combinations of Is Visible nodes and Branch nodes. Put these at the start of your On Begin Cursor Over events to check whether each sphere is visible when the mouse hovers over. Only continue execution (i.e. only change the sofa's material) if the hovered-over sphere is currently visible.

I know the second suggestion is a lot better than the first, but I wanted to mention both to hopefully explain a bit more about why things were behaving unexpectedly in the first place.

Anyway, give that a shot and let us know if it works. Good luck!

more ▼

answered Nov 20 '18 at 05:50 PM

avatar image

1.2k 4 5 8

avatar image Anand Kumar Nov 21 '18 at 12:24 PM

I tried the second option using Is Visible and Branch node to achieve it. thank you so much for the alternative suggestion.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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