# Spin sprite around another sprite in 3d raycasting

**URL:** <https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236>\
**Category:** Help\
**Created:** [December 20, 2023, 5:28pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236 "2023-12-20T17:28:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethan](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@ethan](https://forum.makecode.com/u/ethan)\
**Post date:** [December 20, 2023, 5:28pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/1 "2023-12-20T17:28:05Z")

</div>

is there any way to make a sprite rotate around another in 3d? sort of like the weapons in wave survival games that rotate around you. (as simple as possible i might have been coding for years but im still beginner level)

---

<div class="post-metadata">

**Author:** ![CreativeUsername](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/creativeusername/32/9601_2.png) [@CreativeUsername](https://forum.makecode.com/u/CreativeUsername)\
**Post date:** [December 20, 2023, 6:25pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/2 "2023-12-20T18:25:28Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/2226bb0377ca06eaf30e18cb6fd81c201ea32196.png)  
Maybe try something like this?

I recommend speed to be set to around 0.04 since the milliseconds counts up quickly  
Distance could be set to around 15

There could be a simpler solution but this is just what I had in mind

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [December 20, 2023, 6:25pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/3 "2023-12-20T18:25:36Z")

</div>

This could be useful: [Is there any way to make a sprite orbit around another one?](https://forum.makecode.com/t/is-there-any-way-to-make-a-sprite-orbit-around-another-one/19865)

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [December 20, 2023, 7:12pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/4 "2023-12-20T19:12:46Z")

</div>

> **[Spin](https://arcade.makecode.com/S14964-28795-02374-85978)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Something I came up with

---

<div class="post-metadata">

**Author:** ![ethan](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@ethan](https://forum.makecode.com/u/ethan)\
**Post date:** [December 20, 2023, 10:39pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/5 "2023-12-20T22:39:27Z")

</div>

i tried that i cant figure out how to get it to work in raycasting mode

---

<div class="post-metadata">

**Author:** ![ethan](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@ethan](https://forum.makecode.com/u/ethan)\
**Post date:** [December 20, 2023, 10:40pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/6 "2023-12-20T22:40:36Z")

</div>

its perfect but spamming creates traps

---

<div class="post-metadata">

**Author:** ![ethan](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@ethan](https://forum.makecode.com/u/ethan)\
**Post date:** [December 20, 2023, 10:40pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/7 "2023-12-20T22:40:43Z")

</div>

im goodat math but i havent learned the advanced math yet like cos and sin so i wouldnt be able to make that on my own

---

<div class="post-metadata">

**Author:** ![145145](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/145145/32/17436_2.png) [@145145](https://forum.makecode.com/u/145145)\
**Post date:** [December 21, 2023, 10:30pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/8 "2023-12-21T22:30:45Z")

</div>

lol make it a gam try to catch it

---

<div class="post-metadata">

**Author:** ![ethan](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@ethan](https://forum.makecode.com/u/ethan)\
**Post date:** [December 22, 2023, 8:51pm UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/9 "2023-12-22T20:51:10Z")

</div>

im not sure how that would work, but it does sound very fun to play

---

<div class="post-metadata">

**Author:** ![Faxx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/faxx/32/28828_2.png) [@Faxx](https://forum.makecode.com/u/Faxx)\
**Post date:** [May 5, 2024, 3:42am UTC](https://forum.makecode.com/t/spin-sprite-around-another-sprite-in-3d-raycasting/25236/10 "2024-05-05T03:42:16Z")

</div>

I wanna make a enemy that follows me but it’s not working can someone help
