I’d be curious to know whether a non-active physics body can intercept rays.
The Physics API and MTE’s movement functions don’t play particularly nice with each other at the moment when they’re both acting on the same object, but this is something I will definitely rectify in the next update, perhaps sooner if I can nail down a quick fix to tide things over.
EDIT
I’ve come up with a possible fix, if you’d like to try it. Open mte.lua and navigate to line 9428, which is in the update() function. You’ll see the following block of code:
local object = objects[key] local velX = object.deltaX[1] local velY = object.deltaY[1] local remainingVelX = abs(object.deltaX[1]) local remainingVelY = abs(object.deltaY[1]) local velXSign = 1 local velYSign = 1 if velX \< 0 then velXSign = -1 else velXSign = 1 end if velY \< 0 then velYSign = -1 else velYSign = 1 end while remainingVelX \> 0 or remainingVelY \> 0 do local vX local vY if remainingVelX \> blockScaleX / 5 then vX = blockScaleX / 5 remainingVelX = remainingVelX - blockScaleX / 5 else vX = remainingVelX remainingVelX = 0 end if remainingVelY \> blockScaleY / 5 then vY = blockScaleY / 5 remainingVelY = remainingVelY - blockScaleY / 5 else vY = remainingVelY remainingVelY = 0 end moveSprite(key, vX \* velXSign, vY \* velYSign) end table.remove(object.deltaX, 1) table.remove(object.deltaY, 1)
Comment it out and add this replacement block of code:
local object = objects[key] local velX = object.deltaX[1] local velY = object.deltaY[1] if object.bodyType then object.x = object.x + velX object.y = object.y + velY else local remainingVelX = abs(object.deltaX[1]) local remainingVelY = abs(object.deltaY[1]) local velXSign = 1 local velYSign = 1 if velX \< 0 then velXSign = -1 else velXSign = 1 end if velY \< 0 then velYSign = -1 else velYSign = 1 end while remainingVelX \> 0 or remainingVelY \> 0 do local vX local vY if remainingVelX \> blockScaleX / 5 then vX = blockScaleX / 5 remainingVelX = remainingVelX - blockScaleX / 5 else vX = remainingVelX remainingVelX = 0 end if remainingVelY \> blockScaleY / 5 then vY = blockScaleY / 5 remainingVelY = remainingVelY - blockScaleY / 5 else vY = remainingVelY remainingVelY = 0 end moveSprite(key, vX \* velXSign, vY \* velYSign) end end table.remove(object.deltaX, 1) table.remove(object.deltaY, 1)
This should hopefully allow the movement functions to operate normally without modification to your original code.