# Locate as sprite within the camera (display variable on screen)

**URL:** <https://forum.makecode.com/t/locate-as-sprite-within-the-camera-display-variable-on-screen/14206>\
**Category:** Arcade\
**Created:** [June 24, 2022, 5:38pm UTC](https://forum.makecode.com/t/locate-as-sprite-within-the-camera-display-variable-on-screen/14206 "2022-06-24T17:38:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barry-Williams](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/barry-williams/32/5394_2.png) [@Barry-Williams](https://forum.makecode.com/u/Barry-Williams)\
**Post date:** [June 24, 2022, 5:38pm UTC](https://forum.makecode.com/t/locate-as-sprite-within-the-camera-display-variable-on-screen/14206/1 "2022-06-24T17:38:49Z")

</div>

So I am a teacher using makeCode arcade and often my students would like to use a variable to limit the number of projectiles and would like to display the number of projectiles remaining on screen.

I am aware of a variety of ways of doing this like using .say (but that is not an ideal location)  
Player2 score would also work but is not ideal

Using text sprite works but I need a way to locate this sprite at the same location in the camera at all times.

I can figure this out using camera.(x|y) or also stay on screen but is there a simpler way to do this before I make an extension for my students to use?

Something similar could also be useful for a multiplayer game

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [June 24, 2022, 5:57pm UTC](https://forum.makecode.com/t/locate-as-sprite-within-the-camera-display-variable-on-screen/14206/2 "2022-06-24T17:57:14Z")

</div>

It sounds like you want to use the `relative to camera` sprite flag. Here’s a quick example:

> **[Untitled](https://arcade.makecode.com/55745-39727-55462-40064)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

This flag makes it so the position is not tied to the camera’s movement - i.e. setting left to 0 will always hug the left side and setting right to 160 will always be right next to the right side.

---

<div class="post-metadata">

**Author:** ![Barry-Williams](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/barry-williams/32/5394_2.png) [@Barry-Williams](https://forum.makecode.com/u/Barry-Williams)\
**Post date:** [June 27, 2022, 8:19pm UTC](https://forum.makecode.com/t/locate-as-sprite-within-the-camera-display-variable-on-screen/14206/3 "2022-06-27T20:19:30Z")

</div>

Yes that is exactly what I was looking for, thankyou
