How do I assign a specific sprite to a 3d Shape?

0 favourites
  • 11 posts
From the Asset Store
Template for a basketball game with a 3D aspect (illusion of 3D)
  • Hello everyone,

    I'm back with a brand new problem that's giving me a headache. Here is the concern:

    I decided to create several 3d Objects to make enemies. For each 3d object I create a random sprite from my sprite family. So far so good, but the problem is that I would like to assign each sprite created to a unique 3d object and that's where I'm struggling. I tried something by applying an instance that takes the UID of each 3d Object but I don't know how to make the sprite in question be used for the corresponding 3D object.

    The final idea is to have enemies with different behaviors playing their own animations.

    I add the c3p file here so that it is clearer.

    Thanks for your suggestions and help!

  • Oh thank you! Seems I miss this one.

    So basically there is something to do with containers but I don't get it. Too bad that the exemples were in wetransfer, all links are expired now :/

  • GeoffB Can you share the file if you still have it? I really don't get how it works with the explanations on the topic you shared.

  • I tried different things (here) based on Ashley response:

    Put the sprite used for 3D shape's faces in a container with 3D shape. Then each 3D shape has its own sprite instance to go with it, and it will use the current animation frame of its own sprite instance. So then you can control the face images independently by controlling each of the sprite instance's animations independently.

    But I'm totally lost. It really doesn't do anything I want, it just take the same sprite from the family and don't make a difference between the instances. Just repeating the same thing…

    If anyone has the solution, I will be so grateful…🙏

    (I'm a little desperate now)

  • Anyone?

  • Hi, here's a (hopefully permanent) link to my sample: 1drv.ms/u/s!AhWRm9FAXcyGktgF6srfrFpCvPC4HQ

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi! Thanks a lot GeoffB, I can see now that it was close with my previous version.

    So, I tried to change my version [here] but I still have some questions with it. How am I supposed to link my sprite to my 3d shape's face as it seems in the end that it take it randomly? I mean, specify the UID in the instance is working fine but in the end I cannot choose which one of my sprite displayed on the scene will be choose by the 3d shape. There is something I definitely don't get because if I add new 3d shape and sprite in on your sample it works fine but not with my mine… How is it possible? (and why don't you use containers as it was suggested by Ashley on the other topic?)

  • I'm not totally sure why you set things up the way you did, but here's a version that uses both UIDs and containers (two different objects for the 3dEnemy and Skeleton). Both are totally fine, but they'll have their quirks that you need to work around.

    1drv.ms/u/s!AhWRm9FAXcyGkthpl9UzhyOfFA2W6Q

    PS: don't set UIDs in the editor, as you never know when deleting something is going to break other things. Rather specify them at runtime.

  • Ok I think I start to understand a bit more how I can manage this. Seems my main error was the use of the family instead of a single sprite (containers don't work with Family anyway).

    I will continue my research about this and I will share the final result here for the others guys like me in search of a solution.

    Thanks a lot for your help!

  • Hello, so for everyone who is looking for a solution about this, you can check this file.

    Hope it will help a bit!

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