I'm making a Platform-Maker and I need to get the position of the mouse, then I place a object in there. Then I need to store it into a array so I can convert it to code later on. Right now I have to store it into a array, but when I do that it Gives me an empty array:
Edit On Image: This array is suppose to be containing A Vector3 Position where the mouse was clicked.
from ursina import *
from ursina.prefabs.sky import Sky
from ursina.shaders import basic_lighting_shader
app = Ursina(borderless = False)
window.fullscreen = True
window.fps_counter.enabled = False
editor = EditorCamera()
camera.fov = 90
class StartPlatform(Entity):
def __init__(self):
super().__init__(
parent = scene,
model = "cube",
position = (0, 0, 0),
scale = (10, 2, 10),
collider = "mesh",
shader = basic_lighting_shader,
texture = "white_cube",
color = color.lime
)
class AddPlatform(Entity):
def __init__(self, position = (0, 0, 0)):
super().__init__(
parent = scene,
model = "cube",
position = position,
scale = (10, 2, 10),
collider = "mesh",
shader = basic_lighting_shader,
texture = "white_cube",
color = color.azure
)
def input(key):
if held_keys["escape"]:
quit()
def update():
if held_keys["left mouse"]:
platform= AddPlatform(position = (mouse.world_point, mouse.world_point, mouse.world_point))
platforms = []
for i in platforms:
platform[i].append(platforms)
print(platforms)
Sky()
StartPlatform()
app.run()