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. 

Attach blueprint scripts to multiple actors

Hey all,

I wanted to ask about the possibility of attaching the same blueprint to several actors/pawns/characters. A problem that I have is that I have lots of enemies in a game that act pretty similar in most ways; that is that they try to move close to the player, they damage them, they take damage themselves, etc. But what I have done recently is duplicated the blueprint and created many enemies from it. However, if I want to modify its basic behaviour (say there is an improvement I can make to it that all of my enemies inherit, such as the way it deals damage; like adding knockback) I have to make this change in every single blueprint.

In unity, when I make a script, I can attach that script to every enemy. So if I make adjustments to that scripts it updates it on each enemy. Then I can add another script for unique behaviours and modify the variables for core things like movement speed and damage.

Thanks.

Product Version: UE 4.16
Tags:
more ▼

asked Oct 31 '17 at 04:57 PM in Blueprint Scripting

avatar image

Raxs_Slayer
168 8 15 19

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

1 answer: sort voted first

Look into blueprint components, they're most likely exactly what you're looking for:

https://www.youtube.com/watch?v=qr4ZjieAQKY

You will want to get familiar with inheritance, too:

https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/Blueprints_Advanced/2_5/

Combining both of the above will give you plenty of flexibility.

more ▼

answered Oct 31 '17 at 05:04 PM

avatar image

Everynone
14.6k 76 25 61

avatar image Raxs_Slayer Nov 01 '17 at 09:39 AM

Bang on! Thank you so much (:

(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