UPBGE 0.3.0 Ray is not working

I am working on making a game with tanks but my bullet system isn’t working

This is the tutorial I used https://www.youtube.com/watch?v=59wcPYg2Ymk&feature=emb_logo

I followed it, but the ray is not working

The little red box behind the tank is where the ray should come from

Likely the ray is working but bge.render.drawLine() is what is not supported yet

I place a object that is a plane that is 1 bu long on X axis and then align it to the other point and use local scale to stretch between the two points.


added = own.scene.addObject('Line',own,1)
added.worldPosition = p1
v2 = added.getVectTo(p2)
added.alignAxisToVect(v2[1],0,1)
added.localScale = [v2[0] , 1, 1 ] 

Okay, that is what I get for using an experimental version of UPBGE, but I like eevee so it is staying. I still have to figure out why my cube isn’t reacting to the ray

I recently removed bge.render.drawLine support because it was done with direct openGL calls and as the eevee’s developer is beginning the transition to vulkan, I thought we could remove direct openGL calls.

In counterpart, I added pre/post draws callbacks (from blender official) which can do such things.

I didn’t tested,but there are examples here: https://docs.blender.org/api/master/gpu.html?highlight=gpu#module-gpu

I’d add a pre draw callback for that…

EDIT: I only managed to have it working in POST_VIEW, so instead of using bpy draw_handlers, you can use bge post_draw callbacks with the code to draw a line (more handy imo)