Questions tagged [scale]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
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 ...
w94n9's user avatar
  • 21
0 votes
1 answer
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 ...
Raffaello's user avatar
  • 125
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 ...
blov's user avatar
  • 1
0 votes
0 answers
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 ...
Dylan Levine's user avatar
0 votes
1 answer
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 ...
Cei's user avatar
  • 863
0 votes
0 answers
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,...
Utkrist Karkee's user avatar
0 votes
0 answers
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, ...
Logan Gomez's user avatar
0 votes
0 answers
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 ...
Soya's user avatar
  • 1
0 votes
1 answer
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: ...
Canox's user avatar
  • 103
0 votes
0 answers
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: ...
Makaron's user avatar
  • 35
1 vote
1 answer
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 ...
stingalimian galimian's user avatar
0 votes
1 answer
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 ...
利维坦's user avatar
0 votes
0 answers
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 ...
Hzata's user avatar
  • 1
1 vote
1 answer
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 ...
Erel Segal-Halevi's user avatar
0 votes
1 answer
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 ...
Jhax's user avatar
  • 3
2 votes
1 answer
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 ...
Kon's user avatar
  • 88
2 votes
1 answer
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. ...
happun's user avatar
  • 31
1 vote
3 answers
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 ...
Majs's user avatar
  • 405
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 ...
Fez Vrasta's user avatar
0 votes
1 answer
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 ...
davidA's user avatar
  • 141
0 votes
2 answers
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 ...
Accumulator's user avatar
0 votes
1 answer
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/...
Megidd's user avatar
  • 141
2 votes
1 answer
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 ...
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
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 ...
Akros's user avatar
  • 15
0 votes
0 answers
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 ...
HateDread's user avatar
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 ...
ina's user avatar
  • 294
1 vote
1 answer
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 ...
Pheonix2105's user avatar
0 votes
0 answers
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 ...
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
  • 321
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
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 ...
Ali Kanat's user avatar
  • 143
0 votes
1 answer
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 ...
Thijser's user avatar
  • 965
2 votes
1 answer
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:...
DavidColson's user avatar
-1 votes
1 answer
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 ? ...
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,307
1 vote
1 answer
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 ...
Jane Azel's user avatar
0 votes
0 answers
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+...
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
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 ...
yah_nosh's user avatar
2 votes
2 answers
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 ...
liaquore's user avatar
  • 121
0 votes
3 answers
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, ...
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
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....
Ziya Ceferov's user avatar
0 votes
0 answers
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 ...
mgs_bravo's user avatar
12 votes
3 answers
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) ...
Sh.Adel's user avatar
  • 191
0 votes
1 answer
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 ...
Sabin Pyakurel's user avatar
0 votes
3 answers
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 ...
user's user avatar
  • 257
0 votes
1 answer
209 views

Scaling web game to suit any screen size

I've made a simple multiplayer game, and now trying to make it fit on any screen size. I've tried stretching it out to fit the browser size, but it just appears weird and distorted. I'm also trying to ...
Sarah's user avatar
  • 59