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"

How to cast to an actor with a certain variable value?

I've been looking for an answer to this a lot, but couldn't find anything useful. Basically, I'm trying to make a system where a switch actor is supposed to activate a door actor. Doors and switches are connected with an "ID" that is an instance editable integer variable. Switches are supposed to activate doors with the same value. The problem is that I can't find anything to plug into the Cast node that will specify the actor with that integer. alt text

I probably don't need the part that checks if the values are equal if I can get that to work

Product Version: UE 4.20
capture2.png (88.7 kB)
more ▼

asked Feb 17 '19 at 12:58 AM in Blueprint Scripting

avatar image

1 1

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

1 answer: sort voted first

You need a reference to the door. If your door is a BP and placed the door in the world, then you can make a variable of that type in the switch BP and click the eye to expose it in the editor. alt text

when you place that bp in the level, you will be able to set that variable in the details panel. You canselect a door in the level with the eyedropper.

alt text

You could also, get all actors of class like this:

alt text

either way, you need a reference to the door. Other options would be an interface or event dispatcher.

Hope that helps! GL!

switch-bp.png (58.4 kB)
editor.png (775.2 kB)
getalldoors.png (87.2 kB)
more ▼

answered Feb 17 '19 at 02:32 AM

avatar image

31 4 6

avatar image Nebula Games Inc Feb 17 '19 at 05:03 AM

As the above poster mentioned you need a reference for this to work. If you have trouble creating one or need to know a few ways to make the reference check out this link, the final video in the series is all about creating references. You can see which method will work best for your situation.


(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