How do I assign a specific sprite for each 3d objects?

0 favourites
  • 4 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • Hello everyone,

    I have an issue actually with my game and can't figure it out. Maybe my method is not the easiest one for what I want to do but here are the facts:

    I have a family object created for each of my enemies name "NME_Top". It's a simple 2d sprite where I can put all my behaviors and instances so I can edit each one easely.

    Then for each of my "NME_Top" objects there is a 3d object created over it named "NMETop_3D". It's the same for every "NME_Top", it purpose is only to display the ennemy sprite on the right face. The sprites are in a family named "NME_Top_Sprite"

    So first I call a function to create both my 3D object but also the right sprite from the family.

    The function itself is quite simple, I set the variables for the 3D object and the sprite object so they can match with the right "NME_Top" object.

    Then when the function is called and the 3D object and sprite created, I make the 3D sprite follow the "NME_Top" object and set its right face on the sprite object. Then for every movement, the good animation is played.

    Unfortunately, I can't understand why for each 3D object, "NMETop_3D", the same sprite is called. It's a problem because each 3D object is supposed to call the sprite object with the same ID instance I have assigned for both of them.

    I guess the main problem is because of the family objects but I'm sure there is a way to make this work.

    I'll be glad if anyone knows how I can fix my problem!

  • Is this the sort of solution you're looking for? construct.net/en/forum/construct-3/how-do-i-8/assign-specific-sprite-3d-173729

    In a nutshell: use containers for the 3D objects and their sprites, then you can pick the corresponding sprites without any effort.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi GeoffB! Yes, I know this subject is still about 3D objects and their sprites, maybe I should continue this on the previous topic.

    But my problem is slightly different this time, as I can't use containers. As we know, families can't be used for containers so using parent UID fits more with this, as I want my picked sprite to be different with some conditions.

    So yes, containers are greats but it can't work in this case.

    So I create the correct sprite according to a specific instance, like:

    -> System: Create object NME_Top.ObjectTypeName&"_Sprites" on layer "HiddenSprites" at (700, -100), create hierarchy: False, template: ""

    but the 3D object doesn't pick the correct sprite. Even if I use an instance UID comparison.

    My main problem this time is to use a sprite from a family, so I don't need to create a specific 3D object for each enemy I want to spawn.

  • After some research I finally identify where the problem come from.

    When I try to replace my 3d object's face with a family object, it break it.

    In the end, if I have more than one object in my family it won't work and it will only accept one object.

    So if anyone knows how I can fix this, I will be really thankful!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)