#How to change plane of drawn CollisionPolygon3D?

2 messages · Page 1 of 1 (latest)

hard stone
#

Hi all, I've never worked with CollisionObject3D before. I think the idea I'm trying to go for is as follows: in my game there's an island, and I have a RayCast3D that bounces around randomly in the area of the island spawning in flowers at the point where it collides with the island's surface (this is already correctly implemented). What I want to do is to be able to designate a specific section of the island to limit this to. To start, I had the idea of using an Area3D with a CollisionPolygon3D on the x-z axis created in the shape of the section of the island I want included, and I can check whether the RayCast3D collides with that before spawning in the flower. When I try to draw the CollisionPolygon3D, it always draws on the xy plane. Is there any way to be able to draw it on the xz plane? Or is there perhaps something better/simpler to use than a CollisionPolygon3D? Thanks!

deft abyss
#

What id do is give the island its own trimesh static body ( the mesh button at the top of 3d view ). It only shows up when you select a mesh.

Then create another custom staticbody3d, using default shapes ( which can be adjusted ) or a custom shape you import.

Then put the custom staticbody3d in its own layer. This will prevent it from messing with other collisions like movement but still be effected by the raycast or projectiles.