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"

When casting to an actor, it always fails because of the wrong input.

So, since the answerhub decided to remove all the work I put into writing this up once, I'll keep it short. This is what I have:

alt text

I'm trying to cast to the Hook (A normal actor BP) from the Level Blueprint.

But the Input for "Object" doesn't accept anything. I've tried many many many different nodes and none of them cause the Cast to succeed. The only one that I have found that doesnt cause an outright error is the "Get owner" Node, but even that causes the cast to fail. Like so:

alt text

alt text

alt text

So I beg you all, which node exactly is it asking for? I have done SO much research on this and read all the 'theory' behind casting, but for over 2 months now I have yet to figure this out. Please help, If this isn't the right way to go about getting information (such as variables) from an Actor, please let me know how else I can do it. This has been a huge annoyance to me lately and I just cant get it right.

TL;DR, What node do I input for an actor BP under "Object"?

Product Version: UE 4.8
Tags:
screenshot_4.png (15.3 kB)
screenshot_1.png (139.9 kB)
screenshot_2.png (517.5 kB)
screenshot_3.png (104.6 kB)
more ▼

asked Nov 20 '15 at 10:45 AM in Blueprint Scripting

avatar image

Smileymaster
3 1 2 3

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

1 answer: sort voted first

Hi Smileymaster,

The cast node wants an instance of an object, not the blueprint (which is like a template used to create instances). If you want to use the level blueprint to cast an actor contained in the map, follow these steps

  1. Select the actor in the map

  2. Open the level blueprint

  3. Right click in the event graph and choose Create a Reference to [Actor] alt text

  4. Connect the instance node to the Object pin of the cast node alt text

There are other ways to find instances of objects, Like the GetAllActorsOfClass node. It allows you to specify an actor type (this is where you'd enter the Hook blueprint) and will return an array filled with every instance of that class that currently exists.

Hope this helps you.

create_ref.jpg (41.4 kB)
cast_to_hook.jpg (34.0 kB)
more ▼

answered Nov 20 '15 at 01:31 PM

avatar image

Alderbit
881 36 14 60

avatar image Smileymaster Nov 20 '15 at 09:58 PM

Shweeeet!

I think it worked! wooooo~ Thank you so much man :D

(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