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"

Visibility By Actor Location?

Hi All,

I have a drawer with very heavy props inside. Basically, I want the props to become invisible when the drawer is closed, and become visible as soon as its interacted with. This would be easy, but i have a matinee actor animating the drawer. To cut a long story short i really need the visibility to be set to off to when its in the default position, and any other time it needs to be on.

Is that possible. Im assuming with Get actor location node, but i cant figure out a good way to implement it.

Thanks for the help

Product Version: UE 4.18
Tags:
more ▼

asked Apr 03 '18 at 09:07 AM in Blueprint Scripting

avatar image

Dark_Jubei
177 33 46 53

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

1 answer: sort voted first

Hi Jubei

Consider animating that behavior with custom events. You can then use the same custom events to toggle visibility via Set Actor Hidden In Game. Better yet, reconsider needing to toggle visibility at all. Keep in mind that you do not waste rendering cycles because the game will automatically apply ambient occlusion. Until such time as the player opens the draw, the contents will not be rendered anyway due to AO.

If this is a multiplayer scenario and you're concerned with hackers, visibility won't do anything anyway and you're approaching this entirely wrong - you will have to go back to my first suggestion.

Good luck

more ▼

answered Apr 03 '18 at 09:18 AM

avatar image

gk0r
161 1 6 5

avatar image Dark_Jubei Apr 04 '18 at 09:17 AM

Hey gk0r,

Thanks for the considered response. This is actually a demo for an event showing off some design work, its really very basic im not worried about networking or hackers etc. The only thing I'm concerned about really is poly count affecting the VR headset. Rendering is fine, but it just makes things run a bit smoother if those objects are hidden at the beginning of play until interacted with. Its more of a poly-count issue than anything else.

I hope i didn't miss understand your comments. What i was looking for really was a way to take those poly's out of being processed until/unless they are needed. I was thinking perhaps LOD's could work, but what i really wanted was "when actor is in this position, set visibility off, otherwise, set visibility on" would you know the blueprint nodes for that sequence?

Thanks again for the help

avatar image gk0r Apr 04 '18 at 11:07 AM

Hi Jubei,

Have a look at this video, Tim Hobson explains how Occlusion Culling works in Unreal Engine. TLDR - UE4 does not render polygons that cannot be seen by the player. So if you are concerned about performance, don't be. Hiding the mesh will not do anything, because it's already not being rendered. UE4 is pretty smart like that. Watch the video for full explanation and console commands that can help you validate that. If you still have a problem, reply here and we'll look at your real problem.

Some people relentlessly pursue questions to problems that only exist in their heads. In answer to your very specific question - yes, you can control visibility via actor's location. You can create a Blueprint and add logic to use Get Actor Location on Event Tick. But I warn you, you will be trading CPU cycles (this would be performed dozens/hundreds of times every second for every such actor. It is far from clear as to which would be worse. First watch the video and validate whether or not you have a problem in the first place. Don't over engineer something you don't need to worry about. Premature optimization is a recipe for disaster

avatar image Dark_Jubei Apr 04 '18 at 06:05 PM

Ah i follow you now! In that case, that is VERY helpful indeed. Thanks so much for the help.

avatar image gk0r Apr 05 '18 at 12:18 PM

You're welcome. If you're happy with the answer, please mark your question as answered. This will help other people who are looking for unanswered questions.

(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