I am having trouble getting vexpressions to work inside of DOP nodes.
My goal with this setup is to have an agent go towards object A using a pop steer seek, and once it reaches some threshold, then go to object B. If I just key the weight parameter between the two seek nodes, then things work as expected, but I need to make this more automated.
Since turning the weight parameter to 0 seemed to make the agent 'lose interest', I had the idea of using the Vexpression parameter to query how far away my agent is from the object, and if below some threshold set the weight to 0. However, I can't seem to figure out how to do this.
Using a pop wrangle node, I can change the color of my agent for example once it reaches the target, but I can't seem to use this code inside of the vexpression. I tried something simple like just setting the steer weight to 0, but with no luck. So I think I can't figure out how to properly connect to parameters and attributes using vexpressions.
My original pop wrangle node code:
// dynamic agent position
vector agent_pos = @P;
// bed pos
vector bed_pos = point(1, "P", 0);
// distance threshold
float max_dist = 2.5;
//distance of agent from bed
float dist = distance(agent_pos, bed_pos);
// if dist is close enough, color
if(dist < max_dist){
@Cd = {1,0,0}; //eventually this would be replaced with turn off 'interest/weight' in steerforce
}
If anyone has suggestions or can point me in the right direction, would be much appreciated.