How to move Anchor Point with code?
-
@iTap-Development Ok, so they're answering a question that's not this question?
-
@Deeeds I think they maybe thought that the “anchor” did what you needed. Which, as far as I can tell, it doesn’t.
-
@iTap-Development I still have no idea what they're talking about. The anchor is a specific feature of any object in a 2D or 3D space. They don't seem to be talking about the anchor.
And yes, you've guessed right, rotation is the issue, around a point that's arbitrary, and dynamic. And gets around the snapping problem of anchor points in the editor.
-
@Deeeds they are talking about the “anchor” that you can drag when selecting an object for a behavior. I think they thought that that anchor could be used to set the anchor for the object, but it is actually used for selecting positions for certain behaviors(and in many behaviors, It does nothing).
I don’t know if you saw my post, but the anchor point seems to be snapping to its own grid relative to the object. So if you rotate the object, the grid gets rotated. I can see that could be useful for some things, and for others not so much. Maybe a toggle is needed?
You could search for, or find in my posts, a thread related to making your own anchor point. It’s kinda a lot of work, but if you need an anchor bad it might help.
-
If you can understand what’s happening in this screenshot, it shows you the only possible ways to ever change an anchor while the project is running, in a behaviour, not the anchor of the object itself.
-
@Aidan-Oxley oh I see what you mean. That anchor is pretty much an offset of the objects real anchor. That won’t help with rotation though.
-
@iTap-Development If you have a Rotate By or a behaviour similar to that, and you set the anchor to something other than 50 50, it will rotate about the anchor you put in.
-
@Aidan-Oxley But you can't set this anchor point, for rotation, with code... right?
-
@Deeeds Yes, using Set Input Field. You know how that works right?
-
@Aidan-Oxley That's not moving the anchor point, that's changing the rotation.
I'm asking if it's possible to move the anchor point with code.
Not a virtual anchor point.
The anchor point.
-
@Deeeds Yes, I’m stupid. Didn’t look at what I was doing. Erm, maybe this doesn’t work for rotations, but it does for Move to Object, or Rotate to Object.