I am back at it again with another question regarding the movement of objects using a tween script. So I was told that I would have to make an new script for each moving platform I wanted to create in my game, however, when I use the code (line for line) from the tween-position script it’s not working. Same thing goes for my rotation script, however, for this I’d only need to make 3 of them each for a different axis (if we don’t account for making different speeds.)
If you can use the same code, you can use the same script. For example, if you want to move every platfrom to the left and back to the right, you can use the same script on every platform.
I guess you mean the script below? It looks like you have changed the name of the script. Parse the script after changing the name. Right now the attributes are also not visible in the editor. The same goes for the rotation script that doesn’t work.
If the pivot of the model is in the middle you don’t need a tween to spin the gear. You could try to use the rule below in the update function of your script. Please find the right axis yourself. You can change rotate direction with positive or negative rotate speed.