Example: Object Holder Y = 55 Object Y = 10
I want to like, if its on the center of the object holder(Y = 27.5), it will be 50 the value and if its on the top, the value is 100, in the bottom is 0.
I'm not sure I fully understand
x/maxX gives a range from 0-1 if you want you can multiply that by 100.
in your case it would be (objectHolder.y-object.y)/objectHolder.height
-1 would be bottom, 1 would be top and center would be 0.
https://drive.google.com/file/d/1_-4xCVsCPA7r5cY1sZGRTtZ5bK5kyIFE/view?usp=sharing
Develop games in your browser. Powerful, performant & highly capable.
thanks... but when the object gets to the center the value goes to 0 instead of half of the value
nvmd i just figured out