I have this code and it’s not working properly
It triggers and according to the print() it creates the object, but it’s invisible in the game.
this is the code:
import bgeimport random from bge import logic def create(cont): scn = logic.getCurrentScene() plane = scn.objects['trigger_p'] cont = logic.getCurrentController() own = cont.owner ray = cont.sensors["Ray"] if ray.positive: newPlane = scn.addObject("P"+str(rand), plane, 500) plane.localPosition.y = plane.localPosition.y + 300 MAX_PLANES = 2 rand = random.randint(1, MAX_PLANES) print(rand) print(newPlane.localPosition) orientation = newPlane.orientation.to_euler() orientation.x = 0
and according to print(newPlane.localPosition) this newPlane has a location, which should mean that it exists right?
I just don’t see it in-game
Thanks in advance,