Greetings to the forum!
I am making a tower defense game. It is going pretty good and I have lot of fun. Already got up a GUI so I can choose different towers. My problem is that I want the tower to follow the mouse so i can place it on the map.
I use a thing you call egg from the sample asteroids: models/plane and applying a image (texture) to it. The game is in 2D. Depth is 55 and I am using reparentTo(camera).
I did try to divide resolution with depth but that leaves the image like 1/3 behind:
x,y = base.mouseWatcherNode.getMouse()
x = x*(base.win.getXSize()/depth)
y = -y*(base.win.getYSize()/depth)
self.obj.setPos((x, depth, -y))
How to get the plane follow the cursor?