Skip to main content

Questions tagged [scale]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
93 views

How should I go about handling multiple phone resolutions from a reference resolution?

I built my entire game in Unity based on my Android phone resolution, both for UI and object sizes. Now, everything looks good for a 1080 x 2400 resolution, but I know that's not the aspect ratio of ...
Usylom's user avatar
  • 31
0 votes
1 answer
65 views

How to control the scaling/cropping of a background image

I created a new scene in Unity, dragged an image file, and scaled it to fit the screen size. Here is how it looks like in the Scene panel: When I change the screen size, e.g. by switching to ...
Erel Segal-Halevi's user avatar
0 votes
2 answers
64 views

How to properly control speed of sprite scaling to create "hallway" effect

I'm working on a project (in Gamemaker GML, so JS-like) that involves manipulating 2D sprites (scale and position only) to generate a(n intentionally hacky) visual illusion of moving down a 3D hallway....
bryin lyin's user avatar
2 votes
1 answer
130 views

What should I use as source of truth for sizing sprites?

Let's say I have a texture atlas of an entity A which is 950x800, each frame has a size of 95 (width) and 100 (height) in pixels. Additionally, I have a 2150x1300 atlas, which contains more frames. It ...
Steyrix's user avatar
  • 259
0 votes
1 answer
58 views

SDL2 oversized pixels

I pulled my SDL2 game out of cold storage and am working to get it running again. I found a curious thing: graphics primitives based on SDL2_gfx and text based on SDL_ttf are displaying way too big, ...
Joymaker's user avatar
  • 121
2 votes
1 answer
226 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 ...
w94n9's user avatar
  • 21
0 votes
1 answer
75 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 ...
Raffaello's user avatar
  • 125
0 votes
0 answers
58 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 ...
blov's user avatar
  • 1
0 votes
0 answers
119 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 ...
Dylan Levine's user avatar
0 votes
1 answer
77 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 ...
Cei's user avatar
  • 873
0 votes
0 answers
137 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,...
Utkrist Karkee's user avatar
0 votes
0 answers
65 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, ...
Logan Gomez's user avatar
0 votes
0 answers
44 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 ...
Soya's user avatar
  • 1
0 votes
1 answer
52 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: ...
Canox's user avatar
  • 113
0 votes
0 answers
572 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: ...
Makaron's user avatar
  • 35
1 vote
1 answer
304 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 ...
stingalimian galimian's user avatar
0 votes
1 answer
238 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 ...
利维坦's user avatar
0 votes
0 answers
317 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 ...
Hzata's user avatar
  • 1
1 vote
1 answer
2k 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 ...
Erel Segal-Halevi's user avatar
0 votes
1 answer
190 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 ...
Jhax's user avatar
  • 3
2 votes
1 answer
762 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 ...
Kon's user avatar
  • 88
2 votes
1 answer
1k 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. ...
happun's user avatar
  • 31
1 vote
3 answers
2k 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 ...
Majs's user avatar
  • 415
21 votes
7 answers
10k 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 ...
Fez Vrasta's user avatar
0 votes
1 answer
898 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 ...
davidA's user avatar
  • 141
0 votes
2 answers
293 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 ...
Accumulator's user avatar
0 votes
1 answer
794 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/...
Megidd's user avatar
  • 141
2 votes
1 answer
186 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 ...
Matti Kettu's user avatar
0 votes
2 answers
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 ...
Ali's user avatar
  • 55
1 vote
1 answer
109 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 ...
Akros's user avatar
  • 15
0 votes
0 answers
239 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 ...
HateDread's user avatar
0 votes
0 answers
26 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 ...
ina's user avatar
  • 294
1 vote
1 answer
521 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 ...
Pheonix2105's user avatar
0 votes
0 answers
542 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 ...
mirkojpn's user avatar
2 votes
1 answer
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 ...
MrRobot9's user avatar
  • 331
0 votes
1 answer
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 ...
Josh Sanders's user avatar
4 votes
1 answer
350 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 ...
Ali Kanat's user avatar
  • 143
0 votes
1 answer
141 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 ...
Thijser's user avatar
  • 955
2 votes
1 answer
400 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:...
DavidColson's user avatar
-1 votes
1 answer
292 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 ? ...
user43474's user avatar
  • 537
0 votes
0 answers
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 ...
DyingIsFun's user avatar
  • 1,317
1 vote
1 answer
179 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 ...
Jane Azel's user avatar
0 votes
0 answers
102 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+...
Michael Hampshire's user avatar
0 votes
1 answer
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. ...
silviubogan's user avatar
1 vote
0 answers
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 ...
Martins's user avatar
  • 11
1 vote
0 answers
149 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 ...
yah_nosh's user avatar
2 votes
2 answers
954 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 ...
liaquore's user avatar
  • 121
0 votes
3 answers
7k 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, ...
Randomizer420's user avatar
1 vote
1 answer
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'...
Eduardo G.R.'s user avatar
0 votes
1 answer
355 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....
Ziya Ceferov's user avatar