link with nearest object

mamithaa
Contributor
Contributor

link with nearest object

mamithaa
Contributor
Contributor
I have a set of helpers and planes distributed horizontally, I want to make each plane adds to itself "Position Constraint" to link with nearest 4 helpers without change its position.
0 Likes
Reply
Accepted solutions (1)
643 Views
1 Reply
Reply (1)

mamithaa
Contributor
Contributor
Accepted solution

p = $plane** as array
a = p.count
select $plane*
for i = 1 to a do
(

selection[i].pos.controller = Position_List()
selection[i].pos.Available.controller = Position_Constraint()
selection[i].pos.controller.SetActive 2
)


o = $point** as array
s = o.count

for b = 1 to a do
(
for j = 1 to s do
(
d = distance p[b] o[j]
if d < 60 do
(

p[b].position.controller.Position_Constraint.appendtarget o[j] 50.0
p[b].pos.controller.Position_Constraint.controller.relative = on
)
)
)

 

0 Likes