Topic was automatically imported from the old Question2Answer platform.
Asked By
Suleymanov
Currently I am using:
for p in $Path.curve.get_point_count():
pointPos = $Path.curve.get_point_position(p)
But instead of control points count and their locations, I need baked points count and their locations. I read about get_baked_points() but I don’t know how I can count them and get their locations.
get_baked_points () is an array of positions. To count them use the property of arrays: size. I leave you a small example that duplicates a mesh and puts it in each point of the array, that is, the baked points of the curve. If you reduce the bake interval in the path properties you can see how the points increase.
extends Spatial
var points
func _ready():
points=$Path.curve.get_baked_points()
print(points.size())
for i in points:
var a =$MeshInstance.duplicate()
add_child(a)
a.translation = i
Highly appreciated, Esteban! That worked well. Thank you!