I don’t see anything obviously wrong. It might be worth me pointing out that raycastFirst no longer takes a callback as the third parameter. See the API reference manual on that. That way is deprecated. Now you do something like:
var camera = this.camera;
if (rh===0) {
this.rayStart.copy(camera.getPosition());
camera.camera.screenToWorld(e.x, e.y, 1, this.rayEnd);
this.rayEnd.sub(this.rayStart).normalize().scale(RAY_LENGTH).add(this.rayStart);
var result = this.app.systems.rigidbody.raycastFirst(this.rayStart, this.rayEnd);
if (result) {
// Do something...
}
}
But your should should still work. What isn’t working exactly?
Hi @will, i already tried doing that too, since i guessed that was the case, but i still get the error, when i click it say to check the console and when i check it i have
So that solved your original problem. This is a different problem. It’s now failing when creating a mesh collision shape. Are you able to debug that error? Personally, I would break into the debugger when that error occurs and determine which entity is the cause. Do you know how to do that?
uhm, if the problem is terrain.js the code that create the terrain i can set breakpoints to see when the error pop up, i can cut into segments of 10-20 lines at the start to reduce the range, is boring but useful. Have some better way to solve that to suggest?
Can you create a new small project that you can show this error with please? That will help us be able to look at what is causing the issue and potentially find a fix.
did it, but to rebuild a ‘simple’ test is not easy since every script is tied to another, can’t you just test line 2544 why don’t fire line 2545 in player.js here? https://playcanvas.com/editor/scene/898756
if not i will keep adding scripts to the test scene untill it works.
We could but it’s a lot of code to debug as we don’t know what code is causing the issue exactly and there are other issues in that project making it difficult to isolate. If you can create the smallest example of what is causing the issue, the quicker and easier it is for someone to look at it.
What are the reproduction steps for making the bug happen?