# Questions tagged [scale]

Scale in relation to the geometry, in a game, whether that be 2D or 3D.

180 questions
Filter by
Sorted by
Tagged with
75 views

### Approach to rendering a planet texture

I'm making a space game using Godot 4, and I need to capture the "hugeness" of planets. I figured I'd use spheres with textures on them for planets. The textures have identifiable ...
• 21
64 views

### How to render a portion of a texture (upscaled) without affecting the border with SDL2?

I noticed that render a portion of the texture, upscaling it, it affects is border values with the proximity of the outside remaining parts of the texture (when not using Neareast neighbour ...
• 125
56 views

### Determining meters per second in scaled terrain

I have a terrain with a width of 199 and height of 99 and I'm scaling this train by 500. What would be 1 meter in the new terrain, would it be 500? I'm trying to move my character in meters per second ...
• 1
83 views

### Changing the default 1 Unit = 1 Meter to 1 Unit = 1 Yard in Unity

I am working on an augmented reality project in Unity using MRTK and have just found out that one Unity Unit is equal to a meter in real life. Unfortunately my project needs to be in yards. My current ...
• 101
57 views

### how to move a mesh to be the child of another node?

if i import an item directly unto a bone attachment for some reason it becomes so small it is invisible even tho the bone attachment has a scale of 1 to 1 and was never re-sized also the rotation is ...
• 863
98 views

### Unity WebGL Game's Canvas UI scale changes with windows scale

So this is the setting that is affecting my game. My game is a webgl build from unity running in chrome, hosted on itch.io. At 100% windows scaling setting, the UI elements have expected size,...
62 views

### How to scale a room along the z axis so one wall stays in place and only the far wall moves?

I'm a Psychology undergrad working in a spatial navigation lab where we design Unity environments and have people navigate them in VR. There's a lot of stuff we do here that doesn't involve coding, ...
36 views

### Scale radius used in positioning script to match UI scale

I would like to ask a question about the scaling of objects to the size of the screen. But the question is not a problem that can be solved by setting the "canvas scaler" to "scale with ...
• 1
47 views

### Rotate and Zoom a group of tiles

I'm working on a tile-based game and I'm trying to rotate my tiles as a group around the center of the screen and want to have the ability to zoom in and out. Here my code: ...
• 103
443 views

### Why does my game object scale weirdly when its rotation is changed to 0?

I have a prefab named Spear. It contains a script like this: ...
• 35
1 vote
254 views

### Canvas scaler does not work when the UI is Instantiated at runtime

My canvas scaler does not work when the UI is instantiated dynamically. It does work well in iPhone 6.5 inch simulator: The problem is when I use 5.5 inch or smaller simulator: It does not follow ...
225 views

### Does the scale of a background image affect performance?

I have a background that's a half-square shape. If I increase the size of the background, for example by adjusting the scale of the model from 1x to 10000x, will this affect the performance of the ...
• 43
302 views

### How do I write a script for Unity that allows a gameobject to be scaled using pinch & zoom touch controls?

I need a script for Unity that allows a gameobject to be scaled using pinch & zoom touch controls. I have found lots of answers for scripts that cause the camera to zoom in/out but I want a ...
1 vote
1k views

### How screen scaling works in Unity?

I created a very simple scene, to understand how screen scaling works in Unity. The scene has only a SpriteRenderer object and a TextMeshPro object - no Canvas or other UI elements. The TextMeshPro ...
170 views

### Keeping two triangles with different scale attached during rotation

I'm making a simple Lunar Lander clone. The ship is a triangle, and I'm trying to draw the exhaust fumes of the ship. I'm wondering how to draw the exhaust so it's always relative to the ship. I'm ...
• 3
719 views

### Why do my bullets always go the wrong way when my player turns around?

So I tried to make a shooting mechanism for my game. My player can shoot in the direction pointed by the mouse. My player can also turn around, facing the other way as he walks. The firing mechanism ...
• 88
959 views

### Resize and move widgets when screen resized

I want to add buttons to my libgdx based game and have them be independent of the window's size, but when I resize the window, the buttons stretch and deform instead of being resized and/or moved. ...
• 31
1 vote
1k views

### Thin lines appear differently even though they are the same height

I have an issue that is driving me crazy. All these lines are 2 in height, but when moving around the screen they change thickness. As you can see the top line is thinner. What can be done to make ...
• 405
9k views

### From a game design point of view, what are the implications of using realistic distances in an open world map?

I'm starting an open world game and the plan is to have a single "open world" map that should contain a medieval citadel (1.4 km/2 - taking as example Palmanova in Italy) and some ...
• 313
770 views

### How to use Transform.lossyScale in a local reference frame?

According to the Unity docs for Transform.lossyScale, this attribute is "The global scale of the object". From what I can tell, this isn't actually an estimate of the scaling aligned with ...
• 141
224 views

### How do I set the size of a single 'unit' in my game?

I'm currently trying to remake/port an old game created on Unreal Engine 2.5 to my own engine, and I have access to its physics data. It's using a scale of 80 units per meter, or 1 unit = 1.25cm. The ...
• 796
681 views

### Invert parent transform (doesn't work for combination of rotation and scale)

My problem I'm working with Qt3D and my problem is almost exactly like this one: https://stackoverflow.com/q/60995155/3405291 Suggested solution A solution is suggested here: https://stackoverflow.com/...
• 141
164 views

### Scaling physics engines beyond single computational server

Currently working on a small home project of developing our own game. The game basics are just a straightforward space game, currently without any collision detection/resolution, just movement with ...
2k views

### How to flip the player without local scale and velocity problems?

I'm making a 2D game with Unity. Recently, I've implemented a shooting system. I wanted to change bullets direction based on the player's facing but since the flipping code was changing the local ...
• 55
1 vote
100 views

### How to avoid destroying information when scaling

I'm in the progress of making a simple 3D editor, just for developing skills on 3d graphics. After implementing some basic tools, I realize that scaling isn't working as I expected. For example, when ...
• 15
214 views

### Shifting the world origin and scaling all points?

Imagine you have a simulation in very large coordinates, and to render it out you need to scale it down (say, solar system -> fitting inside a few thousand units). This is controlled by a float ...
25 views

### How to get the bounding box (meters) of an entire Unity gameobject, including all its child objects [duplicate]

How do you get the meter-accurate bounding box of an entire Unity GameObject, including all its child objects? It seems encapsulate bounds does not generate the right units at all ...
• 294
1 vote
483 views

### How do I scale my spell target indicator to match the radius of OverlapSphere

I have a spell system in which some spells have an Area of Effect. To get the targets I use Physics.OverlapSphere. I show the player an indication of the spell's ...
• 554
505 views

### unity spriterenderer scale to fit screen portion

let me explain what i have. a camera that render only a sprite ( sprite renderer) and what i'm looking for is to scale that sprite renderer to fit a screen portion (not the entire screen) for example ...
• 13
2k views

### Unity3D: Convert all game objects to same size irrespective of it's scale

Suppose I have a reference GameObject, Cube, with scale (1,1,1). There is another GameObject with scale (1,1,1), but the size is 3 times bigger than the Cube. How do I dynamically change the scale of ...
• 321
1k views

### Canvas not scaling to screen size

So I have a very simple scene set up with just a camera, a game object called TestGrid with a grid script, and then a canvas. I have a TextMeshPro prefab that I instantiate to fill the 10 x 20 grid ...
• 129
340 views

### How to scale major and minor radius of a quarter torus

I am dealing with quarter tori as in the image below. My issue is that I need to be able to scale its major radius and minor radius separately using a scale matrix. However, when I use a regular ...
• 143
129 views

### Algoritm for scaling an 3D model with fixed edges

I am looking for an algorithm that allows me to scale a 3D model with certain fixed edges. For example scaling up a window should have the frame remain a fixed width while the length of the frame ...
• 965
333 views

### Scaling a rotated child with parent-child transforms

In unity, if you parent something to another object, then give the child some rotation, and scale the parent, the scale applies to some arbitrary axis to the child, here's some pictures to demonstrate:...
• 141
279 views

### Change scale values by Lerp?

How to change the scale values of object by using Lerp. from 0 to 0.01722f and reveals later ? ...
• 537
1k views

### How to change application surface size without changing view size? (GMS2)

I am working on a pixel art project in GameMaker 2 with native resolution 428x240. In order to enable "subpixel" rending, I am trying to increase the resolution of my ...
• 1,307
1 vote
161 views

### How to scale player as they travel between 2 points

I'm doing a VR Project where the player walks down a hallway. The player starts with a size of 10 and is supposed to scale down to a size of 0.5 (well the GameObject in which all the player stuff is ...
97 views

### How can I get my entire game to scale based on screensize?

I'm currently building a 2d mobile game and I'm currently stuck trying to get my game to scale with screen sizes. Currently my background is scaled to 1920 X 1080. When I run the game on my Galaxy S10+...
2k views

### How can I skew a SpriteRenderer in an animation to grow a side and decrease the opposite side by the same amount?

I am interested in the maths and maybe the shader code. I am almost sure that this would be a great starting point but I do not have any knowledge about shaders and the language they are written in. ...
• 143
1 vote
52 views

### Color bands over tile when scaling texture in shader

I want to have tiles with different sprites on the back. Initally I thought I will mix two textures together and then apply mixed texture to game object. I thought that should be easy, but google ...
• 11
1 vote
148 views

### How to calculate rotations for an object with scaling transformations?

I am working on implementing scaling transformations into a game engine (C++), which previously assumed only translations and rotations. Visually, the scaling works, but a lot of the game logic ...
• 21
916 views

### Correct overloads for SpriteBatch.Draw to flip sprite horizontally

I want to flip my sprite horizontally while drawing and I can't figure out how to use the correct parameters without either an error or a warning about the method being obsolete. This is what I ...
• 121
6k views

### Stopping the texture2D from stretching in RawImage

I am working with a RawImage texture which is fully stretched, filling up the entire scene. I am using some code to download images from website and then show them on the RawImage, the code is simple, ...
1 vote
2k views

### How can I convert screen coordinates from a click to 2D scaled world coordinates?

I need a way to convert screen coordinates obtained from mouse clicks to world coordinates in my 2D game. To create a zoom effect controlled by the user, before drawing a model I will scale all of it'...
• 115
343 views

### How to scale a sprite on x axis to touch the point without changing pivot?

I have a sprite. The pivot is at random point. I want to increase the sprite's scale on the x axis, without moving the pivot, until its edge touches a point at right. I have a method to set/add size....
• 111
164 views

### scale on z axis move

At the position z = 0 my box has size on one side 0.2. When, for example, I move it to z = 1.5, size of it scale up. I've trided to calculate it by using triangle formula z*tan(fov/2), but it does ...
41k views

### Scale camera to fit screen size unity

My background and gameobjects are 2d sprites not UI images ,I want to know how to make my background scale with screen size and positions of 2d sprits on it don't change after building game (webGl) ...
• 191
5k views

### How to scale an object in one direction without moving the opposite edge?

I am using Unity. In my game, I have an SpriteRenderer and I'd like it to increase its size I'd like it to lengthen to the right, without moving the left edge. I tried changing its scale to ...
118 views

### How can you tell if you are a large player on a large map or a small player on a small map?

If everything is scaled by a constant factor, can you tell that the world is smaller or larger? I think you could look down at the ground and see that it's "closer". But how do you know what ...
• 257