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. 

How to take control of an arbitrary actor from blueprint?

Hello all,

I'm trying to use a standard blueprint (not the level blueprint) to take control of a selected height fog in the level. I am aware that you need to cast to the actor, which is the obvious part-- the part I am struggling with is how to get it selected in the first place. How do you make it so that the user can select the fog (like, input its name) and then cast to it for the blueprint's actions?

Thank you in advance for any advice on this, I could really use the help!

Product Version: Not Selected
Tags:
more ▼

asked Mar 03 '19 at 10:32 PM in Using UE4

avatar image

CorsairOfLight
25 2 2 5

avatar image IndieGameCove Mar 04 '19 at 01:12 AM

there are various ways to get a reference to a particular actor. i'll list a few. you don't necessarily use casting. 1) using the "get all actors of class"/"get all actors with interface" returns an array, if only one actor of that class exists in the level then you can "get" the first element in the array which is the actor you want.(potentially expensive, don't use on tick) 2) you can create a variable of any actor class. so if you create a variable of type exponential height fog then make that variable public, you can manually assign the fog instance to the variable in the editor. (must compile bp to view public variable in editor) 3) on collision/overlap events return actors as will a line trace.

also rather than having your level manager blueprint get a reference to various blueprints you can have the BPs get a reference to the manager and push themselves into variables. how you get the reference will vary depending on the context. pushing variables can make it difficult to know where the reference is coming from.

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

1 answer: sort voted first

I guess I wasn't clear the first time around. I was trying to basically make it so that you can take control of a skylight or fog and enter it into the public blueprint editor and change its parameters from there.

I found out that you can do it by creating a new fog or skylight variable and making it instance editable. This accomplished what I was looking for.

Thank you for your help on this however, it is appreciated.

more ▼

answered Mar 04 '19 at 07:55 PM

avatar image

CorsairOfLight
25 2 2 5

(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