Jump to content

model or prefab


cassius
 Share

Recommended Posts

I am abit confused about the pros and cons of loading in characters as prefabs. If I create them as prefabs will they still need controllers etc. What are the advantages ( if any ) from a coding point of view.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

It depends on specific need, I mean the Prefabs advantage comes if you need to have something more inclusive than just a model, for example I created a prefab for my Player model which has the following hierarchy:

 

Player [Pivot, with CharacterController physics]

- Avatar model [for example the barbarian]

- Camera already positioned behind the avatar model

 

This way I load this prefab and don't need to create a camera and parent it to the player's model or write a class to change its position every frame (since I need a third person camera).

 

Another example could be a prefab for the enemies, it could contain for example the model itself and an AI attack trigger (well, I didn't look for now about triggers in LE, here I'm just talking by examples that I use on other engines but I suppose it will work here too in similar ways).

 

Another example of use of a prefab could be when you need to have a model with particular material/physics settings different from the original model, this way you create a prefab instead of doing everything through code.

 

Mainly prefabs allows you to setup an entity that else you should do by code at no cost, but they aren't substitutes but complementaries.

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
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.

 Share

×
×
  • Create New...