Questions tagged [scale]
Scale in relation to the geometry, in a game, whether that be 2D or 3D.
182
questions
2
votes
1
answer
103
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 ...
0
votes
1
answer
39
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, ...
2
votes
1
answer
170
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 ...
0
votes
1
answer
70
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 ...
0
votes
0
answers
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 ...
0
votes
0
answers
102
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 ...
0
votes
1
answer
68
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 ...
0
votes
0
answers
125
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,...
0
votes
0
answers
63
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, ...
0
votes
0
answers
40
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 ...
0
votes
1
answer
49
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:
...
0
votes
0
answers
539
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:
...
1
vote
1
answer
285
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 ...
0
votes
1
answer
234
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 ...
0
votes
0
answers
309
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
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 ...
0
votes
1
answer
184
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 ...
2
votes
1
answer
749
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 ...
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.
...
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 ...
21
votes
7
answers
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 ...
0
votes
1
answer
849
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 ...
0
votes
2
answers
270
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 ...
0
votes
1
answer
754
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/...
2
votes
1
answer
178
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 ...
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 ...
1
vote
1
answer
106
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 ...
0
votes
0
answers
229
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 ...
0
votes
0
answers
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
...
1
vote
1
answer
511
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 ...
0
votes
0
answers
527
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 ...
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 ...
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 ...
4
votes
1
answer
345
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 ...
0
votes
1
answer
138
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 ...
2
votes
1
answer
380
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:...
-1
votes
1
answer
289
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 ?
...
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 ...
1
vote
1
answer
173
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 ...
0
votes
0
answers
99
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+...
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.
...
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 ...
1
vote
0
answers
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 ...
2
votes
2
answers
940
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 ...
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, ...
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'...
0
votes
1
answer
351
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....
0
votes
0
answers
183
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 ...
12
votes
3
answers
42k
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) ...
0
votes
1
answer
6k
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 ...