I was setting up a Resource System for one of my games, I working on the Main Parent Actor so it held the Enum so I could set the the type of Resource Each Item would produce (i.e. A Stone would produce stone and so on…] But when I tried setting it up the children would still follow the parent in whatever I set it to be. So I am wondering how do I get the Enum on the children to register what they are and be separate from the Parent Actor. Thank you for reading this.
make the enum variable editable.
Tried this , still coming out as the resource of the parent instead of that of the child. Not sure if it could be the “OR” statement for when the unit is suppose to collect the resource, for if I don’t do that they won’t collect the child resource at all.
You are getting the class base resource, not the child class resource var.
Parent class → create enum variable.
Create child class → Edit “resource” value.
interact with child class → cast to Parent class → get resource… Done.
Sadly the enum would only work the parent object and I could not figure out how to get it work with the children(still new to all of this) so I went with one that I think might work better if I can get it to work. So I Changed the Code with a Code I found in a Template but I noticed it stops right before it can go to the Next step not sure what is going on, but it is suppose to work with Children based on their names. So I hope to figure this out, if anyone has a solution to this let me know:
How are you setting the enum value in the child instances?
- Drag-n-drop, details edit?
- Construction script → set enum?
- Begin Play → set enum
- Exposed/editable var → Spawn actor (set exposed pin)?
I have been just selecting it from the list when looking at the variable setting. Then I did try to set it at Event Begin Play , it would just still default to the Parent. But it looks as if I have tried them all of them but the Spawn Actor. But, the others either defaults to the parent settings or it says “Accessed None” I have tried setting the Resource Base more then once but it still see nothing.
Here is a Post on another forum I started trying to figure out this issue. Then it was not registering anything in the UI. But Now it is. What to do if one Node is not passing to another - #19 by Lonestanding27
You’re not doing something correct, that’s for sure. I’ll whip up a demo on YT tomorrow.
Ok Thank you
did you ever create that demo i’m having a hard time accesing an enum from my child too
My Bad, totally forgot. Probably overwhelmed with work. I’ll do my best to get it done this weekend.
In the meantime…
Parent Class → Enum variable (instance editable)!
Create child class → change value.
That simple.
If you have to cast, then cast to the direct parent of the child.
Hey @Rev0verDrive, did you have a chance to create the video?
I think I did, but I can’t find it. I’ll do another tomorrow for sure.
What specific issues are you having?
So I have buildables and snappable objects in my project. Let’s say I have a pipe connector, and you can snap other pipe connectors on the left and right of the actor, but in the middle of the pipe, I have two boxes that are only valid for snapping pipes. All box collisions are just the same.
I came up with a blueprint interface in which I need to send an enum based on what type of object I am holding right now. I’m not sure if it is a good solution or if it goes against some best practices. It works, though.