I’m using simulation nodes to move an object towards a target. This is part of a larger project where I’m creating a jellyfish that flocks towards an object.
My next step is to get the geometry to rotate towards the object its following, but I’m stumped on how to do it.
I haven’t tried, but I would use align rotation to vector using the direction you calculate from the target location (or the one after calculating the resistance, I’m not sure), and then rotate instance. Of course you’d need to change your single point to an instance, either at the very start (you would then need to store your attributes on the instance domain) or at the very end, using instance on points.
Also, storing post_position is probably unnecessary, since you can access it with position (which you already do), unless I’m missing something.
I’m sorry, I should have clarified my full intentions from the offset. I have tried that approach, the problem it constantly target the object. In this case I want it to rotate towards the object when it accelerates. Here is the full use case:
I do as you suggested at the end, outside of the sim zone. But as you can see above, it constantly orients towards the target. I want a more natural motion, with it only rotating each time it moves.
And you’re correct, storing the post position is unnecessary I think. There’s every possibility I was using at some point, but has since become redundent.
This would have to happen inside the sim zone. The map range is there to control how much the velocity translates to rotation. You said “accelerate” but I assume you meant “move”, although you can derive acceleration from velocity quite easily
I tried it and it looks like it’s not as easy as I thought -I get a completely erratic instance rotation for some reason. If I take the same logic (as pictured above) outside the sim zone, it works fine… not sure what I’m missing. Maybe someone else will point out the obvious.
Later,