Answer the question
In order to leave comments, you need to log in
How to use the OnTriggerEnter() function on multiple game objects?
Good day everyone. There is a game prototype that replicates CubeSurfer's play style. The logic is this - you control the cube, pick up certain objects like a snake fruit, due to which the number of cubes under your feet grows. At the moment, I'm trying to make the player, when colliding with an object collider, just create this cube under the "legs". And the whole problem is that there are three such "collectible" items in the game so far. The player can take only and only one. He doesn't respond to anything else. That is, if you take the first, second or third, the code will work, but then it just skips it. I tried to improvise with RigidBody, but it didn't work out. The player simply flies into the stratosphere upon contact with any object, or creates a cube within a cube, which should not be. Help with advice how to solve this by no means simple (or simple) problem. Here is the complete code overlaid on the three game objects:
Answer the question
In order to leave comments, you need to log in
Look, when the triggers touch, raise the man himself (there was one in the game itself, like you don’t know) and an array of cubes and create a copy of the cube from the very bottom, and if the cube is lost, take away the cube and lower the man and the array of cubes
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question