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"

Detecting overlap event in a grandchild BP actor

Hello,

I'm hoping some more experienced Blueprint coders can offer me some guidance on this problem.

I have a level map containing procedural puzzle Blueprint actor which contains another Blueprint actor. I need to dispatch overlap events from a simple cylinder mesh inside the inner most BP actor and use them all the way back in the the parent level map.

Structure is: Map > Main BP > Child BP > Cylinder Mesh

In the Map i need to have an event fire when the Cylinder Mesh is overlapped by the player pawn.

I've been trying to make this work using dispatchers, but I keep running into confusion with targets / scope. The reason the Cylinder mesh lives inside a Child BP is that it is moved around with other objects as part of the procedural generation of the puzzle in the Main BP.

Here's a visual representation.

I hope I have explained well enough. How would you go about this?

alt text

Product Version: UE 4.18
Tags:
more ▼

asked Oct 01 '18 at 11:57 PM in Blueprint Scripting

avatar image

LoneScrapbot
25 3 4 8

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

1 answer: sort voted first

By "map" do you mean "level BP"?? If yes, then all you need is to select the "cylinder mesh" and right click in the level BP to open up the search bar and you should see "create reference to selected actor" once you have a reference you can say "on event overlap" and then script whatever logic you want from there.

more ▼

answered Oct 02 '18 at 03:17 AM

avatar image

Nebula Games Inc
5.4k 28 9 15

avatar image LoneScrapbot Oct 02 '18 at 05:04 AM

Hi, thanks for your answer. That is how I would normally proceed, however in this case the cylinder is not placed directly in the level. It is dynamically spawned as a component inside a blueprint actor, from within a parent blueprint actor which is in turn placed directly on the map. As such I am unable to create a reference to the cylinder because I can only click on the grandparent BP actor.

so hierarchically it looks like this: Level BP - BP Actor 1 - - BP Actor 2 (dynamically spawned within BP Actor 1) - - - cylinder mesh (a component of BP Actor 2) for overlap trigger

avatar image Nebula Games Inc Oct 02 '18 at 05:53 AM

Then create a reference to the "grandparent" and when it creates the child store a reference to the child and when the child spawns the grandchild create a reference to the grandchild. This way you can get a reference through the grandparent which you said is placed in the level. It's a long process but can be done through the level BP still.

avatar image LoneScrapbot Oct 12 '18 at 03:50 AM

I got this sorted out. Your advice helped me a lot. I was really struggling to nut out dispatchers and hierarchy. Setting a reference to the BP Actors when they are spawned was part A of my solution and then using event dispatchers correctly (which I wasn't) was part B.

Thank you.

(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