1
$\begingroup$

I have a scene where the player can move left to right and can collect coins. I managed to program the counter, but when I duplicate/copy the first coin, it does not render into the game.

enter image description here

Is there a way to copy more coins into the scene without all but one vanishing?

$\endgroup$
2
  • $\begingroup$ Your coin is animated - I'm guessing your coin has animated location, so the duplicate coin isn't dissapearing, it is merely playing the same animation, and thus displaying in the same location as the first coin. To fix this, you can parent your coin to an empty, duplicate them both, and move the empty. That way, each coin's animation will play relative to its empty, allowing you to have multiple coins, and multiple empties. Note: on Stack Exchange, this should be posted as an answer, and not a comment - but I don't feel like writing a full answer. $\endgroup$ – X-27 is done with the network Dec 23 '17 at 5:38
  • $\begingroup$ When I 'grab' the coin, it does only give me one 'point'. But that was the exact problem, I released it from it's animation, and both showed up. $\endgroup$ – Akados Dec 23 '17 at 15:41
2
$\begingroup$

If you are duplicating the object with the animation then the animation is your problem.

See if you have the location keyframed the location is locked to those keyframes. If you duplicate and move that animated object, as soon as you play the animation both objects are going to be in the same place (same location in the animations).

This gif shows the problem animated gif - duplicated objects in the game engine

What you should do, and what X-27 said to do in the comments, is to add an empty in the same location as your coin. Then parent the coin to the empty. Now move the empty to position the coin. To duplicate it again, select both the coin and the empty and put them where you want.

In this gif I show how to duplicate animated objects.
animated gif - proper way to duplicate animated objects

$\endgroup$
1
  • $\begingroup$ It works, didn't know the animation was locked in place. Thank you! $\endgroup$ – Akados Dec 23 '17 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.