Change moving platform speed in code

I’ve got an easy one but its been a while since I’ve used unity and don’t know where to start. I have a object setup with a range setup for a starting position and end position and I want to increase that range every update and be able to tweak speed it goes up I also need for every click to decrease the range sort of like a fight between the auto increase of the range vs how fast you can click so every click pushes it away

Hi,

In which course and lecture are you? Is this for the Project Boost game? If so, you could increase the movementFactor this way: movementFactor += 0.1f * Time.deltaTime;. This will increase the speed by 0.1f per second.

I don’t know what you mean by click or what your idea is exactly but in the Zombie Runner game, we shoot when clicking a mouse button. You could apply that solution to your own game.

I hope this helped. :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms