Relative Content

Tag Archive for c#unity-game-engine

Image not showing when being instantiated

I have a script in unity that makes a copy of an image in a level editor system that creates a translucent copy where the mouse is, for some reason the translucent copy is not showing up but in the inspector it is enabled and everything is the same as the other image apart from the alpha value. The code is here:

Image not showing when being instantiated

I have a script in unity that makes a copy of an image in a level editor system that creates a translucent copy where the mouse is, for some reason the translucent copy is not showing up but in the inspector it is enabled and everything is the same as the other image apart from the alpha value. The code is here:

I need help creating mouse-centered zooming

I’ve been trying to make a system in my 2D unity game where you can zoom in and out by scrolling, and it should center that zoom around the cursor, like zooming in on a web browser. With the way the game is set up, I can’t alter the camera in any way so I’m attempting to do this mouse-centered zoom by positioning and scaling the transform that this script is attatched to (the camera is directly facing this GameObject). I have the scaling part down, but I’ve been trying to get the positioning to work for days and it just won’t work properly. Here is my code.

I need help creating mouse-centered zooming

I’ve been trying to make a system in my 2D unity game where you can zoom in and out by scrolling, and it should center that zoom around the cursor, like zooming in on a web browser. With the way the game is set up, I can’t alter the camera in any way so I’m attempting to do this mouse-centered zoom by positioning and scaling the transform that this script is attatched to (the camera is directly facing this GameObject). I have the scaling part down, but I’ve been trying to get the positioning to work for days and it just won’t work properly. Here is my code.