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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

When you duplicate a blueprint in your scene, how do can you reference each instance of that blueprint in the blueprint itself?

I have a blueprint containing a mesh (BlueprintA), and I duplicate it several times in my scene. But how can I get references to each individual mesh in BlueprintA?

Product Version: Not Selected
Tags:
more ▼

asked May 23 '14 at 10:00 AM in Blueprint Scripting

avatar image

Thunderstorm
97 10 16 18

avatar image brokenpoly May 23 '14 at 11:04 AM

What Thunderstorm is trying to do is spawn 5 similar blueprints in a scene, each with their own "life". At the moment, these blueprints are enemy bots, with simple ai logics set up for when the player gets close etc., but the problem at the moment is that all the blueprints in the scene react when the player gets close to one blueprint/enemy. If an enemy is 5000 units away, he will react when the player gets close to a similar blueprint located another place the scene.

Is there an easy way to fix this and make each of the same blueprint unique in the level?

avatar image Zeustiak May 23 '14 at 11:21 AM

If a blueprint is in the level then it is already unique. You just need to reference it.

If you are already specifically referencing each bot individually then you probably have a problem calling whatever event or blackboard that triggers/runs the AI.

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

2 answers: sort voted first

I managed to fix the problem with some help from my classmate. What I did was to only trace when the attack animation was playing (with a delay), my system for figuring out when to trace was a little overcomplicated, which is what made it trace several times.

Thank you for your help regardless ^^

more ▼

answered May 26 '14 at 03:04 PM

avatar image

Thunderstorm
97 10 16 18

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

How are you duplicating it?

If you are Spawning it, then there is a Return Value that you can use. Otherwise, you will probably have to try a Line Trace or a Sphere Overlap.

Basically you need to get the spawned object's blue Actor reference one way or another.

more ▼

answered May 23 '14 at 10:29 AM

avatar image

Zeustiak
1.8k 131 68 110

avatar image Thunderstorm May 26 '14 at 10:40 AM

how would I go about using the return value, line trace or sphere overlap to get the actor reference?

I am also not currently spawning the blueprint but dragging several instances of it into my scene. It is not a traditional AI blueprint either, just some simple logic to make an actor follow the player and play animations.

avatar image Zeustiak May 26 '14 at 10:46 AM

Sorry, return value on a SpawnActor from Class node(which is the actor that was spawned).

For Line Trace you need to "Break Hit" and then pull the actor out of that.

For Sphere Overlap you just pull the actor out of the array that is generated. If the overlap only hits 1 then the index is 0.

avatar image Thunderstorm May 26 '14 at 10:55 AM

What is really happening is that I do a simple line trace between two sockets on the actor's hand (to find the player). It only traces once when the punch animation is playing. But the problem is that it gets the socket location and animationMontage from all the blueprints in the scene so that it traces every time for each animation, so if I have 3 blueprints in the scene it traces 3 times for each punch of all of the blueprint. In short, they don't act independently.

avatar image Zeustiak May 26 '14 at 11:13 AM

So one punch is thrown and it fires the trace on all actors in the scene that can punch?

It sounds like you are going to need to rework your punch/trace so that it is only being called when a specific actor is doing the action. Sounds like it is being called in general or whenever the class does it(which means all actors of that class do it).

So you need a blue actor variable type reference to the specific actor, and that should be driving the action. Get socket of "Blue Actor Variable Here", fire trace/punch even in "Blue Actor Variable Here".

You can get this Blue Actor reference to the actor on Spawn, using hit events, etc.

avatar image Thunderstorm May 26 '14 at 12:19 PM

Exactly how do I get the actor reference that I can plug into the get socket location node?

avatar image Zeustiak May 26 '14 at 12:23 PM

The actor Return Value when you spawn the actor, a trace/overlap, etc.

You can store the reference once you have it in a Blue Actor variable and it plugs into the Target input on the Get Socket Location.

avatar image Thunderstorm May 26 '14 at 01:56 PM

I'm not spawning my actors, just dragging the blueprint into the scene, so I don't get the return value.

The reason I'm doing this is because when I try to spawn the actor in the level blueprint, it doesn't function properly (it doesn't run around)

(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