Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set physics properties on a PhysicsMaterial. #365

Merged
merged 2 commits into from
Nov 22, 2020

Conversation

rcorre
Copy link
Contributor

@rcorre rcorre commented Oct 6, 2020

Fixes #364.

These are properties only of Rigid and Static bodies.
@Calinou Calinou added the bug label Oct 6, 2020
Copy link
Collaborator

@Jason0214 Jason0214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!

phys_obj['friction'] = rbd.friction
phys_obj['bounce'] = rbd.restitution
if phys_controller != 'KinematicBody':
physics_mat = InternalResource("PhysicsMaterial")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the resource name is still helpful here
image
If there is no good choice, we can just use phys_name + "PhysicsMaterial" 😊

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. I think I just copied from a PhysicsMaterial I created in Godot, which is unnamed by default, but might as well give it a name if we can 👍

```
The method set_friction has been deprecated and will be removed in the future, use physics material instead.
The method set_bounce has been deprecated and will be removed in the future, use physics material instead.
```

Fixes godotengine#364.
@Jason0214 Jason0214 merged commit 27ffa28 into godotengine:master Nov 22, 2020
@rcorre rcorre deleted the physics branch November 22, 2020 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use PhysicsMaterial instead of friction/bounce
3 participants