Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Finding the angle needed to look at something?
- MarpMorp
- Scratcher
15 posts
Finding the angle needed to look at something?
I need some way to find the rotation of an object so it looks at another object. I have the X and Y (and Z because it's 3D) of both objects and I need to have one look at the other. The reason im not using the built in block is because the way I have to turn it uses a custom block with slots for the X rotation and the Y rotation (and the Z rotation) so I need all the angles to be independent calculations. I don't know if any of that made any sense. Any help with my very specific problem would be greatly appreciated.
- The_Imaginarium
- Scratcher
1000+ posts
Finding the angle needed to look at something?
If it's in 3D you're going to have to find the spherical coordinates.
- -CloudGate-
- Scratcher
1000+ posts
Finding the angle needed to look at something?
IDK how to do 3d, but I made a demo of 2d here: I need some way to find the rotation of an object so it looks at another object. I have the X and Y (and Z because it's 3D) of both objects and I need to have one look at the other. The reason im not using the built in block is because the way I have to turn it uses a custom block with slots for the X rotation and the Y rotation (and the Z rotation) so I need all the angles to be independent calculations. I don't know if any of that made any sense. Any help with my very specific problem would be greatly appreciated.https://scratch.mit.edu/projects/612576035/
- Discussion Forums
- » Help with Scripts
- » Finding the angle needed to look at something?