#Where is ReadyDeployObject defined?

1 messages ยท Page 1 of 1 (latest)

merry igloo
#

making thread to not pollute main channel

#

it's in an Actor component attached to the Actor which is responsible for the "Build" mode. i wanted to have a generic update function that each specific buildable class can override that gets called on Tick when that object is up for creation. the Base version is called no problem, but was expecting polymorphism to take over and call my derived class version

gaunt zephyr
#

Are you sure that what you've assigned to it is a ziplinetower instance? You should inspect your data with a breakpoint while it's running.

ruby bloom
#

Because everything else checks out

merry igloo
#

i'll double check, when I spawn my actor I pass in the TSubClassOf<>..... ahhhh ya know what you might be right! it's probably spitting out just the BaseDeployable.... so i'm basically slicing this thing aren't I? ugh, that mean I'll need to cast it before setting the ReadyToDeploy object i guess, was wanting to avoid that

ruby bloom
#

No slicing here, it's a pte

#

Ptr

#

But the TSubclassOf might be set to the base class

merry igloo
#

yeah definitely that's the problem

#

yeah cuz I wanted to have a bunch of objects using the same interface.

ruby bloom
#

What is the value of Deployable?

merry igloo
#

that's what I've circled, it's TSubClassOf<ABaseDeployable> in the data asset i'm using

gaunt zephyr
#

No, that's the type. Not the value.

ruby bloom
#

I know that's the type, but what's the value?

merry igloo
#

sorry, misread... checking now

ruby bloom
#

TSubClassOf holds a class of any kind of ABaseDeployable

#

It'll spawn whatever derived type as long as it inherits from your base

#

And nothing is sliced because you're passing it by pointer

merry igloo
#

yeah it spawns the object as expected, it's the ZiplineTower class.... and the returned Actor from Spawn shows me the BP_ZiplineTower_C..... and then I set it to the cached ReadyDeployObject in the component.

#

here's the data asset where value of Deployable is coming from

#

oh holy shit, i'm so sorry.... i realized my error

#

the BP_ZiplineTower is derived from the base direclty, not the derived class from C++.... i just made these changes and forgot to Reparent

ruby bloom
#

That'll do it

merry igloo
#

๐Ÿ™‡โ€โ™‚๏ธ i'm so sorry to bother you, I knew it was something stupid. thanks for your help though, just needed to track it down and I had square eyes there

gaunt zephyr
#

๐Ÿฆ†๐Ÿฆ†๐Ÿฆ†

ruby bloom
#

Lol, like 99% of problems are "stupid"

#

It always helps to talk it out

#

๐Ÿฆ†

merry igloo
#

agreed, and 80% of the time you need someone else pointing it out. thanks again y'all, much appreciated prayge