Anchor point
-
Since you canāt set the anchor point of an object yet, Iām trying to create my own anchor point. So far I can rotate an object around a point with sine and cosine, but that is from the center of the object. I need it to rotate from a point on the object For example, rotate around the the top right corner.
I canāt seem to figure it out....any help would be great! -
@iTap-Development which behavior are you using?
-
@Justin-Hattaway Iām using quite a few...
-
@iTap-Development You can set the anchor point of an object, if I understand what youāre saying correctly. Anchor point as in when the object moves, the anchor of that object is at the point it moved to, when the object rotates it rotates about that anchor. EDIT: Just after sending this post, I created a random project to mess around with this, Move behaviours les you set an anchor and change the anchor while the project is running, but rotate behaviours donāt. But, if you tap on the object and find the transform object tab (where you can set its scale etc) you can unlock the anchor and change it, then anything you do to the object will be based on that anchor. I think you canāt change this though while the project is running.
-
@Aidan-Oxley yeah I need to be able to set it while the game is running....I have a workaround but being able to set the anchor point(like having an actual behavior) would be best.
-
Haha just reading this and realising Iām doing Sine and Cosine rule at school š . No megusta...
-
@DGames135 LOL I love sine and cosine!
-
@iTap-Development š”how?
-
@DGames135 I love trigonometry, calculus and algebra. In fact, Iām better at that stuff than I am at simple maths š
-
@DGames135 its simple....they work great for my projects, so love is what they get! @Aidan-Oxley so since you love trigonometry, do happen to know the math behind rotating on an anchor? Because I donāt LOL
maybe we should start a new thread and get everyoneās opinion on sine and cosine!š¤£š¤£š¤£
-
@iTap-Development if you really want a trig way it shouldn't be too hard, but here's an easy way using move anchors (if I understand what you want): http://bit.ly/2fS4jj8
It moves to the anchor you want to rotate about, rotates, then reverses the movement of the anchor. -
@Jack8680 thanks I check it out....I did want to do a trig way but I canāt figure it out....
-
@iTap-Development Iām trying to make a trig version, but itās too late for me brain not working past 11 pm lol. Itās gonna end up with like 10x more behaviours than Jackās version š. Iāll do it tomorrow.
-
@Jack8680 I never thought of doing it that way! Thanks!
@Aidan-Oxley lol ok. -
@iTap-Development [0_1507239850952_rotate.tap](Uploading 100%) Hereās a trig version lol. Aww I donāt have the privileges to upload the actual file lol. Link: http://bit.ly/2yrzlps
-
@Aidan-Oxley great Iāll check it out tomorrow....because itās 9:00 pm here and Iām tired!
-
@Aidan-Oxley hey could you explain the āinitial angleā box container and how youāre using it?
-
@iTap-Development Itās the angle from the anchor to the object when the object is at rotation 0Ā°. For example, anchor is 1 metre up and 1 metre to the right (so both positive), so when the object is at 0Ā° rotation, the angle from the anchor to the object is 225Ā° (so thatās down-left). Hope this makes sense.
-
@Aidan-Oxley hey, so Iām just coming back to this(I got a 3d printer so Iāve been busy with that!);
What do you need the āinitial angleā for?
And Iām not sure as to the purpose of the behaviors in the screen shot. -
@iTap-Development those behaviours are Pythagoras' theorem. The result from the square root is the distance from the centre to the anchor point.