[SOLVED] 'setValue' error after raycastFirst

Hi guys.
For a few hours it just showed up an error in my project and I don’t remember this is due of something I changed.
I’m wondering if something in the playcanvas files has changed. I’m not a hard coder to guess it out.
Until yesterday my raycastFirst was working fine, since november that I’ve snipped from a tutorial, now it get a “setValue” error as you can see in the image

My project is public, you can check it out:

I created a new fresh project to see if the command “rigidbody.raycastFirst” still works and it does… in this image you can read “(old)” in an error, is that possible some script from playcanvas codes is outdated in my project? As I said I don’t remember I made any considerable change in my codes or entities to get this strange error so suddenly :frowning:

It seems it was some kind of bug in the engine.
To test it out, I turned off my old 3Dscreen with a bunch of models with colliders and I created another 3Dscreen and created a simple box with collider inside it. RaycastFirst worked as expected, I’ve presumed then I should recreate my old 3Dscreen with the objects but as soon as I turned it back on my raycastFirst started to work again… I remember my browser (Chrome) haven’t closed properly before it and I was working on my project… It also happens when the power energy in my house drops… it looks like if some “brutal” disconection from the server occurs this bug is likely to appear.

Well, now it works pretty well.

I guess your problem was in Ammo.js.
setValue is a method of Ammo.btVector3

So, since you got error only it this place, it’s like your ammo was disabled and typeof Ammo !== “undefined” expression returned true.

Probably, you had this checkbox disabled and it got enabled when you recreated your 3Dscreen or manually… I don’t know.



Hmmm nice observation @mikefinch

I now do remember to uncheck physics cause I was not using gravity or collisions between my objects, but I haven’t guessed it could mess up rigidbody.raycastFirst… And this actually makes sense turning it off rigidbody won’t work.

Thanks, I’ll keep that in mind :slight_smile:

Had the same problem. Thanks