Comments (4)
I also just noticed that updating the shape as follows has the intended behavior:
func _ready():
var new_shape = CircleShape2D.new()
new_shape.radius = 100
$CollisionShape2D.set_shape(new_shape)
from godot-rapier-2d.
Interesting. Will investigate, thanks for the bug report.
from godot-rapier-2d.
It seems when a shape is changed, the shape is destroyed and recreated(probably this can be optimized, this seems to be just code ported from godot physics). But the collider is only destroyed, and the shape itself with all properties isn't destroyed. That's why this happens.
I'm trying to also destroy the shape when it needs updating, see if there are any lose ends. If not i'll try to update the shape instead of deleting it.
from godot-rapier-2d.
Ran the tests, there isn't any issue after the change. Seems to fix this. Only issue I could think of with this approach is if there are any dangling references of the shape handle, but the only place the shape handle reference is kept is on the shape itself, so there wouldn't be any problem.
Will take a note of this bugfix for the rust rewrite also and make sure to re-implement it there as well.
from godot-rapier-2d.
Related Issues (20)
- Area2d Effect not working on pinned objects.
- Rapier incorrectly returns null on state.GetContactColliderObject
- Collision excepted bodies still interact when under continuous collision detection. HOT 2
- Angular velocity on Rigibody2D is not working. HOT 1
- Regressions with physics server collide_shape() query HOT 1
- Removing shapes from a body doesn't work HOT 1
- Area2D doesn't respect collision layers HOT 1
- Rapier2D doesn't work the same as Default with Physics Materials Godot 4.2.1 mono HOT 4
- Deactivated collider and/or collider shape doesn't deactivate. HOT 1
- Rigidbody 2D with no damp still slows down HOT 2
- DOCUMENTATION.md seems to be missing. HOT 1
- Rewrite addon to rust/gdext HOT 2
- Use a data holder and send it through layers
- Game engine hangs in scene with StaticBody2D with a WorldBoundaryShape2D HOT 8
- CharacterBody2D colliding with a CollisionObject queued for deletion causes a crash HOT 1
- Area2D does not scale with parent HOT 2
- PinJoint2D - Rotation very stiff HOT 10
- intersect_shape with a circle with it's origin inside rectangle fails to detect collision HOT 3
- Condition "monitored_objects.has(handle_pair_hash)" is true HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot-rapier-2d.