How to increment value of axis when something happens

I have a player and I want something to spawn beneath the player, but the spawned items will stack up beneath it, in order to not mess up the physics system due to the object spawning inside the player, I make the player jump using jumpforce, but this sometimes messes up the system and the objects merge with each other only to separate with a large amount of force causing player to fly away. Now I want to make it such that whenever the Mouse is clicked or the screen is tapped, the players position automatically increases and then an object spawn beneath it. So lets say the object is of X height. Now I want the player to move up by X whenever the screen is tapped and then the object must spawn below it.
However as you know, we can not add float values to the axis, I realized it the hard way by doing:

player.transform.position = (player.transform.position + (0, 10, 0));

So is there a way to accomplish this? I’ve searched some forums but haven’t gotten the desired results and have been stuck with this issue for a while(More than a Week). It would be awesome if anyone could help me out or just guide me in the right direction :slight_smile:

your syntax is wrong, you have to do

player.transform.position = (player.transform.position + new vector3(0, 10, 0));
1 Like

Than

k you very much, it was a very dumb mistake