What Inherits a projectile?

So, what does the projectile inherit from a parent?

(And yes I know the return node has a warning)

Come again?

Sorry I’m not entirely sure what exactly you mean. A cast is generally only useful when you already have a reference of the actor you want to do something with but it’s not yet the right class or if you want to check which class an actor is.

Since you don’t seem to have a reference at all I’m not sure how to help you.

I just want a health system for the character, but since I don’t know what inherits the projectile, I cannot go any farther with the health system.

hemm, what erasio mean is(if i am not wrong). you have to specified. what object that you wanted to be casted as twinStick Projectile. you can have that from take damage or receive damage event. as a hit actor or something like that.

Actor definitely is a parent of the “Twin Stick Projectile”. Everything is.

But you have nothing to use. You need a reference to your object so inheritance becomes at all important.

Let me use an analogy.

Right now you have nothing in your hand and go around asking if that’s bread.
That’s not the case since you don’t have anything. You need to pick something up for “asking what it is” to make sense in the first place.

To convert this back into Unreal terms you need a reference to your projectile.

You get those by saving the reference when you “Spawn Actor From Class” (if you shoot the projectile) or (if you get hit by the projectile) you have to use “Event Hit” or “Event Overlap”, if you use the “Damage” functionality from Unreal you can also use “Event Any Damage”. Depending on how you set up your projectile and gameplay around it a different one of those makes sense.

They all provide an “Hit Actor”, “Other Actor” or something very similar which is the projectile that hit you.

You can cast this to your projectile class to make sure the functionality you want is only executed when you are hit by the projectile rather than anytime you hit something (which is also walking against a wall for example)

Cheers

Yes you are correct.

My suspicion is that he picked up that term in the unreal tutorials or somewhere and tries to create objects out of thin air via casts (seen that quite a lot recently…)

Now can this be used for a HUD?

I’m sorry but I will not be able to take the time and explain everything you need to understand in order to do this.

It kinda looked like it from the beginning but now I am fairly certain that you are missing quite a bit of knowledge about Object Orientated Programming.

To answer your original question: You can check out the parent of any class in the editor. It’s in the upper right corner. I’ve marked it in this picture. Just open up the class you wanna know about and and look up here

Your problem goes a lot further though. Unreal makes things relatively easy but doesn’t do everything.