Jump to content

Entity::Instance doesn't clone Surfaces


 Share

Recommended Posts

I use the cloning of instances to have different skins for different NPCs. Using the Entity::Instance function go copy the Entity use to have unique surfaces. Now, it's the same reference in all copied objects.

 

The code.

Model* dwarf = Model::Load("Models\\Characters\\Dwarf\\Drawf_full.mdl");
 Model* clone = (Model*)dwarf->Copy(true, false);

 

With a debugger you can look at dwarf->surfaces and each individual object in the vector matches for the dwarf and the clone instance.

 

Using Entity::Copy makes it so the entities don't appear.

Link to comment
Share on other sites

  • 3 weeks later...

The Instance function will use the same surfaces. However, it does look like there is a problem with copying skinned models. Looking into it now.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...