I am still new to Godot 4.1. I am trying to set up a simple sprite with a .png texture to be affected by gravity. I set up a Node2d, then a RigidBody2D as the Node2d's child. I added a CollisionShape2d with a RectangleShape as a child to the Rigidbody2D. Finally, I added a Sprite2d as a child of the CollisionShape2D. The sprite is affected by gravity (it falls down) when I run the game, but the sprite is being resized to at least three times its original size. The original image is 294 * 711. All the nodes have their transform in (0,0) and their scale in (1,1), except the parent, the Node2D which has scale of (0.12,0.193). Why is my sprite getting resized at runtime and how can I fix it? Any help appreciated.
Godot physics resizing my sprites at runtime
331 Views Asked by tutiplain At
1
There are 1 best solutions below
Related Questions in GAME-PHYSICS
- How would I code player jump physics, similar to "soccer physics", and make players collide with a ball in pygame?
- AI and Game physics
- How do I detect for collisions without immediately resolving them in Godot 3D?
- How to find the rotation of a quaternion along each of the 3 axes separately?
- Unity's HingeJoints: Door changes starting Position and AngleLimits on play mode
- Paddle and Ball Sync Problem in Multiplayer Air Hockey in Godot
- Movement value is reset before it can get cancelled by a UnityEvent
- How to make two kinematic objects in Unity detect overlap?
- Jump height and Gravity not consistent with fluctuating FPS (flappybird-like Javascript minigame)
- Game Collision Detection - Separating Axis Theorem Collision Resolution Issue
- Aligning mesh to a dynamic rapier 3D rigidbody
- Player looks like teleporting instead of moving smoothly when camera damping is enabled GODOT
- Collision Detection works only with two objects
- This Unity Jumping & Gravity script is a mess, how can I fix it?
- Grappling/Swinging System in Godot 4 3D
Related Questions in RESOLUTION
- Android: How to scale a bitmap to fit the screen size using canvas?
- Dynamic Resolution Fix to NuxtJS Download Page
- Can uvc-gadget can go up to 4K on a Rasperry Pi 4B?
- How can I fix @media max-width issue in html and CSS?
- Problem with Excel Userform resolution - Text and image enlargement
- How Can I Increase The Resolution Of My Icon In My GUI Window?
- Meaning of PPI (Pixel Per Inch)
- Create gif from tiff images and preserve resolution using PIL
- What is difference between screen size and pixel size?
- How can I adjust aspect ratio on Mi TV Box 2 when projecting content from the side of the room?
- How to stop a numerical resolution of a differential equation with a certain condition
- Is there a possibility to render parts of the screen at lower resolution?
- Godot physics resizing my sprites at runtime
- How to change window size at runtime using Rust and SDL2?
- Formula for converting XY pixel coordinate in 1920x1080 to 1366x768
Related Questions in GODOT
- Godot engine collision with KinematicBody doesn't work
- Godot - set_fixed_process function
- Godot Keyboard Events
- Godot - Using 2D Sprite Animation
- Perlin noise gdscript error
- Godot - Check if Controller connected or not
- Godot - Object doesn't stop when colliding with other object
- Godot - Check if Slider is being hovered over
- Godot - Changing the scene
- Having multiple Nodes2D in a scene or having none - Godot
- Kinematic object does not detect any collisions - Godot
- Paint tilemap around the player
- Godot - Ingore Windows (OS) scalling
- GDScript String format with an array
- I want to install an older godot engine
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
RigidBody2D manages there own transforms, which overrides anything you set in the editor. So in Editor it looks like everything is way smaller, because you set the scaling of the root pretty low, but when you run it, the scaling from the parent gets ignored.
I tried your configuration and if you look at the remote tree, the rigidbody should have a scaling around 8.33 (in my case), which results in everything inside the rigidbody having their normal size.
So set back the scaling on your Root Node2D to 1,1 (if it's only reason was to shrink the sprite) and edit the scale of the sprite directly.
As examples I add the scales I get in the remote debugger.
Scales at runtime, when I use your settings (Node2D Scale 0.12/0.12 everything else at 1/1): Node2D 0.12/0.12 Rigidbody2D 8.333/8.333 everything els 1/1
Scales at runtime, when I use following settings ( Everthing 1/1 but Sprite Scale 0.12/0.12): Everthing 1/1 but Sprite Scale 0.12/0.12