get class from actor

how? there are a ‘get class’ but return class ‘object’ and need class ‘actor’ for spawn actor class

thx

I’m not sure if I understand your question correctly. Are you talking about casting to a specified class?

that my problem from other user capture.

without solution :frowning:

i haven’t luck with UE lol my paths got blocked.

You can’t spawn ‘Object’.

Why you get ‘Object’ class ? What is the purpose of this object ?

i known i can’t spawn a object, that why i need get the class actor, and that why Get Class not work because return a Class Object and i want Class Actor from the “hit actor”…

the idea its simple like you see in that capture (not mine but he have same problem, want something like Shoot->trace-> Break Hit -> Hit Actor -> Get Class’Actor’ of the hit actor and spawn another one. why? think something like if i Line Trace a dog want spawn a dog, if i line trace a cat want spawn a cat.

i must find another way. But the idea was simple, its shame i can’t get the class’actor’

when i saw the “Get Class” i say “nice that going to be easy”… after try connect ! sh*t return ‘Object’

You don’t try to casting to the desired class ?

no cast to actor.

Like this :

4b8d9043e8c91b48ef2d37b1cb452654991e442d.jpeg

:open_mouth: i haven’t ‘Cast to actor’

you have other versión of UE

From your variable object output, drag a link to empty area grid. When the actions choice menus appears, click “Context sensitive” and type “cast actor” in search field.

yep, now thx
but i can’t figure yet how to “spawn actor class”. Going to investigate. lol

Post a capture of your BP to show the problem

my blueprint its simple, like the other guys with the same problem

its exact i want spawn the “Hit Actor”

i try figure how to do for other ways but in the last steps there are always a “Spawn actor class” and i a need a Class ‘actor’.

its simple but i begin think there its no way for do that with blueprint. Anyway i am new.

Casting is not applicable here.

It is possible, but more complicated.

You can see a principle here : http://hpics.li/f2a9ecd

This BP compile fine but isn’t fully functional. And not tried.

1 - Initialize an array of classes with all the classes you want.
2 - Compare in a loop the classes in the array with the class of the hit actor.
3 - If comparison is true, spawn the actor.

Maybe there is a better solution, but i don’t see best.

Ah you need a ‘class cast’ - that is added in 4.1!
4606-casttoactor.png

yeah i read that about 4.1

until 4.1 i wil try something like say Eddy71. thx.

finnally what i do (more easy) since i still with problems for got a f*cking Class’actor’ was

Hit Actor -> Get Display Name -> var

And have a banch for compare the strings and have a spawn actor class with the class already setting for each actor spawn.

more easy than i think in first momment… the problem i need “Spawn actor class” all that stuff for each actor wants spawn.

but well now i can spawn the Hit Actor. i must forget the other procedure before !!!

thx guys.

“Get Display Name” is for display purpose. It is not safe to use in your case and can introduce bugs with engine updates.

Rather replace with the “Class Cast” when 4.1 will be available.

i will do. just want something that work now for continue with other things.