#Where is ReadyDeployObject defined?
1 messages ยท Page 1 of 1 (latest)
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
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.
That is my first guess
Because everything else checks out
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
yeah definitely that's the problem
yeah cuz I wanted to have a bunch of objects using the same interface.
What is the value of Deployable?
that's what I've circled, it's TSubClassOf<ABaseDeployable> in the data asset i'm using
No, that's the type. Not the value.
I know that's the type, but what's the value?
sorry, misread... checking now
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
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
That'll do it
๐โโ๏ธ 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
๐ฆ๐ฆ๐ฆ
agreed, and 80% of the time you need someone else pointing it out. thanks again y'all, much appreciated 