I want to add behaviors to my prefabs so I can deactivate them whenever is needed, as for the moment it is imposible to target a specific child of a prefab with events, but even if it was posible, this will always be convenient.
Can you explain further? You can assign behaviors to the prefab object and to the prefab children. The only issue from my testing is prefab children behaviors can only interact with other prefab children. The prefab behavior applies to the object as a whole.
You can also create functions that apply to child objects.
you can add behaviors to a prefab but not on the prefab editor, only on the scene. On the prefab Editor you can only add beahviors to individual children, but you can’t interact with the children of a Prefab outside the prefab editor.
you can apply functions in the object event sheet but a lot of times it comes handy to anulate a bunch of functions by simply disabling the behaviour that contains them.
I have another feature request regarding the posibility to interact with the childs but this is just about being able to add behaviors to the object that for the momment holds the hit box of the prefab, which is something that will be useful even if the other feature is added.
My Ideal settup is this:
1-A gameCharacterPrefab (I need both features added for this one) for a game that has many playable characters with diferent behaviors and AI, all of the variations are childs of this object;
-The main object runs the creation of its variations, the main hitbox, the variables, the player -ownership on multiplayer and such things.The childs define the size of the hitbox and "artificial inteligence(things like the specific fighting patterns of a character on a fighting game.
This game character Idiealy should be able to directly be imported to any game, with all of its variants, that could inlude all the npcs of a game as well as their 3D models or sprites or whatever.
2-a UIPrtefab (I already have this one)
this object runs all the UI of the game, creates menus, text entries customizable mulktitouch input, storage actions, etc, on the spot without using external layouts.
3-hitBoxPrefab (both features needed for this)
this object runs the creation and lifecycle of things that affect gameCharacters(like:
-fire with behaviors that simulate fire and changes the state of other objects made to interact with it, “burns them”.
-custom projectiles
-items that run their events on their own only when they exist on the scene.
etc.
4-aSceneryPrefab(this one also needs bothe features)
a prefab that creates the world, ¿you want to create your own tile map system instide this object to run complicated stuf like event based terrain generation/modification? ¿why not? ¿want to give ownership of this object to a player and turn them into remote dungeon master for your online tabletop with 3D animations VR implementation? ¿Want to let players save their custom level layouts and share them? This object can run your game like a scene, with the difference that you can summon it on any scene you want, ¿have you ever wondered how do I change a scene after the lobby game started, or, How do I have players on the same lobby interact with diferent scenes at the same time? this is one answer to that question.
A lot of feature requests and comonly asked questions are solved by adding these two features, specially the ones related to the built in multiplayer…
It is unrelated but also very cool
it is actually related to the sceneryPrefab and the UIPrefab, I’m in love, I was placing my stuff with coordinates and functions, and assigning sprites on the scene editor
This is not supposed to be shown. Please, don’t use it as compatibility won’t be ensured on this experimental feature.
Thank you for reporting the issue. It will be hidden back in the next release.
I can’t wait for it to be officially released. There’s a lot of potential. It’s like a scene within a scene like one of those infinity mirrors.
Yes, but for modular programing
Ok I’ll keep doing coordinaties… It was cool, never knew I needed it until I saw it, as I said it makes two of the prefabs I want to make faster to setup
But it’s so perfect , plis don’t take the precious
I was following this and the other thread u made about custom objects.
I’m just curious since i’ve still not tested the function since i’m at 5.3.,(and i’m thinking to upgrade bcs that), but, i remember to have used unity a bit in old times and there are various kinds of controllers that can be used as premade system for a game…like first, third person controller ecc… ecc…where u just need to load your 3d model to make everything work with 0 effort…and i loved em…then i tried the corgi engine (guess it is famous) for 2D.
While i understand the usefulness of prefabs, prefab’s behaviour ecc…, and custom objects in 3D, can someone explain to me how it would fit in a 2d game, where u need to create any sprite differential from scratch?..i mean what does it change from the custom behaviour system or external event system we have rite now…for the 2D side…(where i’m interested the most)
I’m not criticizing, just asking for my personal knowledge…
I consider your request mandatory for a 3D game
I guess, It should allow to:
- Make simple pieces of UI, for instance a yes/no dialog
- Make cards that shows stats like life, attack power…
- Make objects with moving parts, for instance a tank
More generally, things that hold together as a whole.
That is somethin i’m really interested in.
Even if i find it already pretty easy to do, maybe it will be useful for simplify things in complex projects.
Thx as usual for the explanation.
I don’t think I understood the question
No problem.
Davy answered perfectly on what i was asking.