0 votes

Hello All,
I'm experimenting with making semi-random geometry CSGPolygons extruded along paths. I've made a path node that works fine with a test polygon that I've added to the scene tree. However, if I generate a new CSGPolygon from script and try and set to work with the same path nothing shows up.

If I set the mode to extrude or rotate, and it works fine (ie. I'll get a little cube or a squat cylinder.)

I currently have the spatial node the script is on set as the child of the path node.

Here's my code:

extends Spatial

var Leaves = preload ("res://Objects/Leaves for Trees/Leaves.material")


func _ready() -> void:
    FillItIn()


func FillItIn():

   var myMesh = CSGPolygon.new()

   myMesh.mode = 2

   myMesh.set_path_node("..")

   myMesh.set_material(Leaves)
   add_child(myMesh)

I've tried a bunch of variations on .setpathnode() and can't seem to get it. Any assistance would be super!

Godot version 3.3
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.