Cast to actor failed


Screenshot 2023-12-01 164110

how do i refrence this actor right?
the cast always fails…

1 Like

What do you get when you mouse over the warning?

its not showing anymore (i tried some stuff ), probalby “start room does not inherit from…”

its still failing every time

So you have a start room BP that inherits from actor, and an actor object reference variable?

i think so yes :slight_smile:

where is this?

image

in what sort of blueprint?

this is inside of another blueprint class

What type of blueprint, what does it inherit from?

also an actor

I think just drag from the variable again, and search for ‘cast…’ Throw away the current cast node.

You always have to make fresh nodes, you can’t reuse nodes.

still not working :frowning:

I give up :slight_smile:

Can we see full blueprints pls? Also add an IsValid node before cast and print something on fail. Could be a null pointer that’s causing the cast to fail (we can’t see any other part of BP so we can just guess)

1 Like

Yes, it will be null.

The first pic is not helpful… :slight_smile:

Seeing the code that runs after the cast fails doesn’t make it any easier to find the problem I’m afraid…
We need to see where you assign/handle your properties (specificaly start room)

what do you need to see?

I edited the post. Also as I mentioned please add an Is Valid node before the cast, print something on failure, run the code and see if the print node runs. Makes it a lot easier if we know we are dealing with a dangling/null pointer or not…

which properties in specific?

so its not valid…