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"

Cannot use Toggle Visibility for Actor Blueprint

Hello all,

I am trying to create a blueprint in which an object becomes visible once the character enters a box trigger. In this case, the object is a key. Here is the tutorial I'm following as a reference:

https://www.youtube.com/watch?v=8WeE4q6Ba40

This tutorial works fine, but only as long as I use a Static Mesh as my reference (like in the tutorial). It does, however, not work when the reference is a Blueprint that is placed in the level, which is what I want. Since the key in my level is also a collectible and rotates around its own axis, it requires to be scripted with a blueprint, but for some reason once I place the key-blueprint in the level instead of the key-staticmesh, the blueprint for Toggle Visiblity does not work; the key is visible all the time.

Here are some screenshots:

alt text Level Blueprint (the invisible node to Toggle Visibility is Event BeginPlay). Note that here the StaticMesh is now used as the reference; when I replace it with the Blueprint Reference, the script stops working.

alt text Actor Blueprint for the key. This is the Blueprint reference that fails to work.

alt text alt text The level. The orange disk is supposed to act as the trigger. When the character is on the trigger, the Static Mesh key appears. This is the effect I want. If I were to replace the reference with the Blueprint Key (the one on the right), it wouldn't make a difference as it remains visible the whole time.

I am a complete noob at programming and Unreal in general, so if you can help, please explain as if I were a 5 year old ;)

Hope this makes sense!

Product Version: UE 4.10
Tags:
more ▼

asked Jul 04 '16 at 07:45 PM in Blueprint Scripting

avatar image

Stradis
50 17 16 19

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

2 answers: sort voted first

The key-staticmesh works because 'Toggle Visibility' uses a scene component. The key-staticmesh that you're talking about is by default a scene component. Thus, like in the tutorial, it will work as intended.

The key-blueprint, however, is a GROUP of scene components (ie, the DefaultRootComponent, any static meshes, so on). That's why you can't just stick a reference of it into a 'Toggle Visibility' node and expect it to work.

So if you'd like the 'key' to disappear using your key-blueprint, you need to get the reference to that instance of your key-blueprint, get the reference to its static mesh, and then toggle the visibility on that mesh.

more ▼

answered Jul 05 '16 at 03:48 AM

avatar image

Mookaroni
599 21 9 35

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

Oh that makes sense! It worked, thanks a bunch :)

more ▼

answered Jul 05 '16 at 10:32 AM

avatar image

Stradis
50 17 16 19

(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