Godot collisionshape2d extents

phrase, matchless))) Yes, really. All..

Godot collisionshape2d extents

I wanted to change the size of CollisionShape2D during the game, for example: I have a character that can lower, so this causes your Shape2D in y to decrease a bit and the origin I believe has to go down too. How can I do this? If Shape2D shrinks is actually the correct way to do this, since it is as the child of a KinematicBody2D. As for the "Transform2D transform" I saw in the documentation that it is a Matrix32, so I thought of doing so:. I do not quite understand how I would decrease here, I imagine I would have to use "get shape transform" to get the current "Transform2D", and so change only the y where I want, am I right here?

Example, something like:. I'm an animal, I was doing it wrong, I could not get used to this syntax yet. The right thing would be to do this:. Scaling may not work well with Shape2D resources, changing shape values radius, extents, polygon points may be safer, do some tests to be sure. And from what I read in the documentation, just change the scale of circles and ellipses that can not, the other shapes by what it says there it can.

Test with some little experiments with the way you are going to use it to be sure it works may work for some things but not for all features. Also remember that CollisionShape nodes are helpers, most shapes are added to the bodies by reference but some are made by the CS and added to the body like convex polygons. This only if physics start giving weird results on some specific use some physics calculations do not take shape scale into account.

godot collisionshape2d extents

I wouldn't scale a shape, it can make collisions less accurate and I think it might actually make the engine run a bit slower. Setting the extents is the way to go I guess.

CollisionShape2D Class (3.0.2)

I just checked, and the help files says the Extents property is editor-only. So you can't access that from a script. How to resize a CollisionShape2D in game? And this is the best way to do this?

Please log in or register to add a comment. Please log in or register to answer this question. But still I ask, is this the most efficient way to do this? I got it, I updated the answer And from what I read in the documentation, just change the scale of circles and ellipses that can not, the other shapes by what it says there it can. So this is what I did right? That would be SO much easier. I only saw after that there was a ".

How so "extends", how would you do that? I got it, I updated the answer. Just make sure you scale uniformly and it should be good. All categories Engine 13, Projects 1, Gossip I'm trying to do some manipulation of mouse click coordinates which requires using the extents of a CollisionShape2D with shape RectangleShape2D.

Here are the relevant details. I've manually resized the CollisionShape2D so that it covers precisely the subarea of the root TextureRect upon which I wish to capture clicks. This yields the given extent values. My original interpretation of the way Extents work told me that the absolute x-coordinates of the edges of the CollisionShape2D should be. But now I know that isn't how it works since it is plain from the viewport's ruler that the true values are approximately So I think there is something I'm not understanding about how extents work but the only description I've been able to find online is that they are the shape's half width and half length.

So the lengths referred to by the extents must be with respect to some other hidden ruler than the one provided by the viewport, which makes it difficult for me to understand and work with the values. My original interpretation of the way Extents work told me that the absolute x-coordinates of the edges of the CollisionShape2D should be Can anyone help me understand what that hidden ruler is, and how to work with the extent values?

Please log in or register to add a comment.

godot collisionshape2d extents

Please log in or register to answer this question. All categories Engine 13, Projects 1, Gossip Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an Area2D to give it a detection shape, or add it to a PhysicsBody2D to create a solid object.

The margin used for one-way collision in pixels. Higher values will make the shape thicker, and work better for colliders that enter the shape at a high velocity. How much does it cost? What are the license terms? Which platforms are supported by Godot? Which programming languages are supported in Godot? What is GDScript and why should I use it? What were the motivations behind creating GDScript? What type of 3D model formats does Godot support?

How should assets be created to handle multiple resolutions and aspect ratios? How can I extend Godot? I would like to contribute! How can I get started? I have a great idea for Godot. How can I share it? How can I support Godot development or contribute? Who is working on Godot? How can I contact you? Documentation changelog New tutorials since version 3. Importing images Why import them? Dictionary vs. Object Enumerations: int vs.

godot collisionshape2d extents

AnimatedSprite vs. AnimationPlayer vs. AnimationTree Logic preferences Loading vs. But… OK, how? How does it work? Introduction But what are they? What is a Mesh? Creating a new module Using the module Improving the build system for development Writing custom documentation Adding custom editor icons Summing up Binding to external libraries Modules Using the module Custom resource format loaders Introduction References What for?

What not? Read the Docs v: stable Versions latest stable 3.In tutorials i'm watching when you create a CollisionShape2D and set it as for example a rectangle handles will show up that you can drag to expand or reduce it.

Even when just creating a KinematicBody2D those handles show up. How it should look:. How it looks with me:. Your post s were caught by the moderation queue since you haven't confirmed your account yet, there should have been an autimatic email sent with the link to confirm the account, however it might have gone to your spam folder, so check there as well.

For the actual problem, it quite simple, the kinematic body node has no shape, it needs a collision shape node added to it, as the warning hover mouse over the yellow icon next to the node name in scene tree instructs add a child CollisionShape2D node to your KinematicBody2D node, then in the inspector give the newly added node an actual shape. You can input the size manually by clicking the RectangleShape in the Shape property. This will expand the RectangleShape properties, where you can change the size through the extents property.

Sry if i'm not making my issue clear i'm not sure how else to word it, for example i'm on wall6 in this picture i click on the wall6 name in the left of my screen but no handles show up so i can only move wall6 but i can't change the size with handles because there are no handles, why aren't handles showing up when in every vid of godot i have watched so far handles do appear.

Disable snapping, or change the snap grid size, also lock the location of the collision shape so you can't move it instead of using the handles. To change the Shape extents numerically expand the shape sub-box in the inspector with the CollisionShape node selected. I'm not sure how thats suposed to make the handles appear. I guess i'll just have to manually input everything in the scale box instead of using handles. Thanks for wanting to help.

tutorial_physics_2d

At scale 0 there is essentially no boundaries. Just an infinitesimal point at the center. Mind, I'm inclined to make the argument that there is indeed a design flaw at play here, and should probably be reported as an issue to the tracker.

Godot Nodes 101: Area2D Beginner Tutorial

The handles should be offset from the boundaries so that they would be visibly usable even at extents set to 0. Wall 7 is 5 by 3 they don't show up. In the picture you sent, you have selected the StaticBody node, not the CollisionShape node. The handles will only appear if you select the CollisionShape node.

Maybe that would bring up the handles. Confidant if you select your wall node and click on the icon of two overlapping er, rather corners touching I guess? Toggle navigation Godot Forum. Categories Discussions Activity Sign In.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. This is not a bug, the getter and setter methods are not shown in completion when there's a property available.

Thank you for the fast response. So about the shape. I discovered it by reading some comments but I don't find nothing about it in the docs. Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. New issue. Jump to bottom. Labels archived topic:editor. Milestone 3. Copy link Quote reply. Steps to reproduce: Create a CollisionShape2d node as a child of a root node.

This comment has been minimized.

godot collisionshape2d extents

Sign in to view. And thanks for the syntax alternative too. Closing as working as expected. Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment. Linked pull requests.On a different script for the level's sceneI wish to instantiate 2 items - each has its own image with its own size:. My problem: both items are assigned the size of the latter sprite, the cactus in term of collision shape. I figured my code overrides my class, but I just want to configure the instances.

Is that possible? Unless I'm totally misunderstanding how this is supposed to work in godot, this seems like it might be a bug. You should not use CollisionsShape2D from code. It is just a helper node for editor. As an alternative to the mentioned thread, if you only require a handful of different collision shape sizes, you could simply include them all in the original scene, but set them to disabled.

Then, once you've created an instance, enable the collision shape you need based on its sprite I'm a newbie to Godot so I thought it's probably my misunderstanding. Please log in or register to add a comment.

Please log in or register to answer this question.

Handles not showing

All categories Engine 13, Projects 1, Gossip GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account.

Operating system or device - Godot version: Windows 7 64bit Godot v2. The KinematicBody2D also contains an AnimationPlayer, with a 3 seconds long animation consisting of nothing but a single key at the beginning of a track that animates the extents of the KinematicBody2D's collision shape, it doesn't actually change the extents, just sets them to the same numbers that they already had.

This animation does not play automatically or loop, you can make it play once by pressing the Z key. Link to minimal example project optional but very welcome : AnimatingCollisionShape. You can't really animate CollisionShapes with AnimationPlayer, since those are only editor helpers and are disconnected from the actual body shapes at runtime. This will change in 3. On Aug 25,"George Marques" notifications github. You can't really animate CollisionShapes with AnimationPlayer, since those are only editor helpers and are disconnected from the actual body shapes.

Yes, when I searched for this issue before posting I saw that it used to be impossible to do, but was apparently added in September It's a very useful feature and I've been relying on it for my project.

Worked fine while all I was colliding against was static bodies but when I threw area2d into the mix it started to misbehave. Well, if they should work but are not, then it's a bug. Maybe the hacking wasn't so thorough. Thanks puppetmaster and everyone, sorry for wasting your time. Not a bug after all.


Samusho

thoughts on “Godot collisionshape2d extents

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top