Hi, my question might be easy for you but i started programing in general just yesterday and I want to learn myself, my question is how to make so if a player touches/grabs an object (in my case coin) his speed increases by 20% and then goes down to normal.
Hi and welcome, The overall idea is something like this: 1. Detect collision with a pickup. Make the pickup a trigger unless you want the player to actually collide with it (if you would use Physics.) 2. Use OnTriggerEnter to run some code that performs the speed increase. 3. In your player script, have a speed modifier. Change this speed modifier and apply it's effect to the movement of the character controller or a physics based object your player controlled object is. 4. In the player script, build a timer which you activate when this pick up event happens. When the timer has expired, disable the effect of the speed up.