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

Mesh collider no longer scales in real time #6212

Open
Latenos opened this issue Apr 2, 2024 · 1 comment
Open

Mesh collider no longer scales in real time #6212

Latenos opened this issue Apr 2, 2024 · 1 comment
Labels
area: physics Physics related issue bug

Comments

@Latenos
Copy link

Latenos commented Apr 2, 2024

Description

I have been unable to update the mesh collider scale since around March of this year.

I have prepared a minimal project on this issue, please see
https://playcanvas.com/project/1204845/overview/meshcolliderscaletest

This project has 4 spheres in a box.
A tween changes the size of the box.
I want to smoothly scale the mesh collider to match the scale of that box.
If I can correctly scale the mesh collider, the movement of the spheres should change.

I suspect the reason is that the following code in realtimeScaling.js is not working for some reason.
col.system.implementations.mesh.doRecreatePhysicalShape(col);

Previously, in order to resize the mesh collider in real time, the above code could be called every frame to do the update.
However, one day it stopped working.
I understand that this is a very costly process, but I really need this.

I have been developing a project that uses this program for a long time and it did not work on previous projects either.

Any help would be much appreciated.
Thank you very much.

@Latenos Latenos changed the title Scaling of mesh colliders in real time Mesh collider no longer scales in real time Apr 2, 2024
@mvaligursky
Copy link
Contributor

Yeah this really needs some solution, there are multiple issues created for this, for example #3062

As a workaround, you could considering clearing the _triMeshCache mentioned here: #4181

That might let you re-create the scaled collider correctly. Not a proper solution, but maybe something to get you going till this is fixed.

@mvaligursky mvaligursky added bug area: physics Physics related issue labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: physics Physics related issue bug
Projects
None yet
Development

No branches or pull requests

2 participants