Scaling imported models
Hey,
I am toying with the LaserGun from the tutorial and trying to replace the example assets with custom models. For some reason the mesh I am importing for the LaserShot replacement is not scaling. All I am trying to do is replace the cylinder with a model that has an emission material on it.
I have tested using a primitive cylinder from the shapes menu and it scales fine, albeit on the wrong axis, but easily fixable. The gravity, physics and collisions are set correctly as the example LaserShot.
The code makes sense and I've ran various debugs to make sure things are calculating correctly:
Seems to be working now, so what I believe was the issue came down to using "replace" and "update" of the model after changing pivot points. It is a nested object. I am not sure if that is a known bug, but happy to log it if anyone wants to point me in the right direction.
There was also a large offset from
this.props.laserBeam.moveRelativeTo(this.entity, new Vec3(0, laserLength / (2 * thisEntityScaleY), 0))I settled with the Y value of Vec3 set to thisEntityScaleY and it looks fine. Also worked well just setting it to 1.
Phew, now I can move on 😅 Thanks for the response SeeingBlue 😎