Proposal: Entity Prefabs #1962
Replies: 2 comments
-
I think that would work really well for weapons/items, but wouldn't be that great with the player class example. If each class has different weapons, the prefab would either have to support arbitrary children (which may not make inventories happy) or just declare an item list - both of which would be better handled by a resource. But also I feel like this is just a blatant stepping stone to having Unity-style prefabs, which frankly would be really nice. Being able to set up an object ahead of time to be called in at any time without a bunch of annoying setup would be great. Separating out a prefab's job and a resource's job would also make it a lot clear when and what to use each for. |
Beta Was this translation helpful? Give feedback.
-
At first I didn't think we would need this given that we have GameResources like you mention, but I've found myself basically making a system for using |
Beta Was this translation helpful? Give feedback.
-
Something I find that people are doing with
GameResources
, is speccing out an entity. So things like player classes, or weapon classes. Then on those defining things like jump height, icons, sounds, recoil and damage values.This is cool but I'm wondering if we could boil it down to what it is.
An entity prefab, at its heart, would be a
GameResource
type. It'd have a dropdown (or something) allowing you to pick an entity class from your game.. then once selected it'd have a bunch of properties that are on that entity. Here we could use all properties, or have special attributes that you fill out.The properties could be configured in a way where their values are forced to the prefab value - so that if you change the value in the prefab it'll change all values on the entities in game.
Beta Was this translation helpful? Give feedback.
All reactions