You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Supposedly AS3 passes all objects as reference, but this does not appear to be the case with the "Result" FlxPoint in FlxTilemap.ray(). Checking the Result value always results in null.
Why is it necessary to do the raycast in this manner? Why return a boolean at all if you can just return the FlxPoint (if the ray hits anything) and check for null?
The text was updated successfully, but these errors were encountered:
… always null
I believe this issue was caused by the user mistakenly passing in a null pointer. I've just updated the code slightly to make it more obvious how it works, and to remove an unnecessary FlxPoint creation.
Supposedly AS3 passes all objects as reference, but this does not appear to be the case with the "Result" FlxPoint in FlxTilemap.ray(). Checking the Result value always results in null.
See this stackoverflow question for a very similar situation:
http://stackoverflow.com/questions/3708371/actionscript-pass-by-reference
Why is it necessary to do the raycast in this manner? Why return a boolean at all if you can just return the FlxPoint (if the ray hits anything) and check for null?
The text was updated successfully, but these errors were encountered: