Jump to content
Aveyond Studios Community
Amaranth

Drag hero object into scene

Recommended Posts

Funny, I was going to suggest this:) Or maybe you mean something else.

To clarify, do you mean that a prefab can be dragged in hierarchy (in scene) and it will automatically be a hero gameobject? I ask this because I did Tutorial 5 and dragged the prefab into the hierarchy (which seems to add to scene), but it was not a Hero GameObject. I wouldn't even know how to convert it (and could this cause issues using HeroKit?).

Share this post


Link to post
Share on other sites

I think we are looking at it from a different angle. I'll post some info to help demystify. :-)

 

A prefab is a template for a game object. It exists as a file in the Project Tab. When you drag it into the hierarchy, Unity creates a game object in the scene, based on the prefab.

 

In HeroKit, prefabs are only used for visuals. You can attach a prefab to each state in a hero object. Why do this? The most important reason is that we want your items to have states. And each state might need a different model (vampire, pile of ashes). 

 

I could make it so that any prefab dragged into the hierarchy becomes a hero object, but I think you would eventually want to chase me down with a pitchfork. Why? When you design your scenes, you're going to need lots of objects that just exist to look nice and never change (rocks, trees, houses, etc). There is a slight performance cost if you add a "brain" to thousands of these things. 

 

Instead of having everyone do this:

1. create hero game object in scene

2. create hero object

3. attach hero object to hero game object

 

I'm going to see what I can do to have everyone do this:

1. create hero object

2. drag it into the scene (just like you did with your prefab)

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

This is working now BUT the icon looks like this when you drag a hero object into the inspector. It's a little confusing from a usability perspective. Hunting for a solution now...

 

yMmZGz0t.png

Share this post


Link to post
Share on other sites

Note: drag hero object into Hierarchy View did not work in Unity 2017 BUT it does work in Unity 2018. This is was a bug introduced into Unity 2017 that affected lots of tools developers and is now fixed.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...