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"

Casting to the Actor Blueprint

Hello...So I have this Actor "Door" and I'm trying to access it from another blueprint and I'm using Casting,but When I use Cast to Door,I can't find any proper object for it,so the cast always fails.Any suggestions what should I do?I know what objects I should use,when I'm working with Game instances,Game modes or ThirdpersonCaracter,but this is just an actor that has no parent.help?

Product Version: UE 4.19
Tags:
more ▼

asked Jun 20 '18 at 01:31 PM in Blueprint Scripting

avatar image

tatopk123
26 2 4 9

avatar image ThompsonN13 Jun 20 '18 at 01:45 PM

you need a reference to the door that your trying to affect. you could do this by using traces, overlaps, public variables, or another method, it really depends on your situation. give some more info on your use case and i can give you a more specific answer.

avatar image tatopk123 Jun 20 '18 at 01:52 PM

Okey,I have the actor Door and I have the Animation Blueprint of the main character in which I have state "Opening Door".So I need something to connect to "Can Enter Transmision" for this to work. In the Door Blueprint I have this variable "CanET" which is supposed to connect to the Can Enter Transmition,that's why I need to access the Door Actor so I can get "CanET" variable and connect to Can Enter Transmition.

avatar image Felix Leonhart Jun 20 '18 at 01:47 PM

can you make a screenshot of the problem?

avatar image tatopk123 Jun 20 '18 at 01:58 PM

alt text

alt text

I'm trying to reach the "CanEnterTransmition" Variable which is in the Door BP from the Animation Blueprint,that's why I'm casting to the Door

capture.png (652.2 kB)
capture1.png (388.4 kB)
avatar image ThompsonN13 Jun 20 '18 at 02:55 PM

i probably would have used a overlap event in this case like what you have but then just set a variable in the character or someplace that is easy to access in the anim bp. ill post some pictures below to show what i mean.

alt text

alt text

capture.png (124.7 kB)
capture1.png (121.2 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You can refference the door in the Level blueprint (just drag and drop the actor from the editor to the blueprint)and from there send it as a variable to Game instances,Game modes or ThirdpersonCaracter. In Game instances,Game modes or ThirdpersonCaracter don't forget to check if the value is valid.

more ▼

answered Jun 20 '18 at 01:59 PM

avatar image

Felix Leonhart
496 3 4 7

avatar image Felix Leonhart Jun 20 '18 at 02:06 PM

Like this alt text

avatar image tatopk123 Jun 20 '18 at 02:10 PM

That would work only if I had just one door,but there are more than one door,can't reference them all

avatar image Felix Leonhart Jun 20 '18 at 02:14 PM

you need reference to it only if you get close to it?

avatar image Felix Leonhart Jun 20 '18 at 02:23 PM

If so you can use tracing. It traces in front of character to check if there is a door. Though you should tweak the values to fit your character and level design. Making a separate trace channel for it is also an option

alt text

avatar image Felix Leonhart Jun 20 '18 at 02:26 PM

my small mistake - the Casted Door should connect to Door Ref, not the hit actor

avatar image Felix Leonhart Jun 20 '18 at 02:12 PM

also you can set the DoorRef type as a Door object reference - that way you won't need to cast anything - UE4 won't permit you to connect it to "Set DoorRef" if it's not a door

(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