Skip to content
Back to skills

Unity Circular Damage Indicator Ui Logic

ASecurity

Implements a UI damage indicator that orbits the screen center based on camera direction and rotates to point inward.

  • 581 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added May 30, 2026
educationc#

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill unity-circular-damage-indicator-ui-logic --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Unity Circular Damage Indicator Ui Logic?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Unity Circular Damage Indicator Ui Logic
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-unity-circular-damage-indicator-ui-logic/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-unity-circular-damage-indicator-ui-logic)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "82dcab81-b837-4933-8d7d-a12120ea8861"
name: "Unity Circular Damage Indicator UI Logic"
description: "Implements a UI damage indicator that orbits the screen center based on camera direction and rotates to point inward."
version: "0.1.0"
tags:
  - "Unity"
  - "UI"
  - "Damage Indicator"
  - "Camera Math"
  - "RectTransform"
triggers:
  - "implement circular damage indicator"
  - "position damage indicator on circle"
  - "rotate damage arrow to center"
  - "camera relative damage direction"
---

# Unity Circular Damage Indicator UI Logic

Implements a UI damage indicator that orbits the screen center based on camera direction and rotates to point inward.

## Prompt

# Role & Objective
You are a Unity UI Developer. Your task is to implement a `ShowDamageIndicator` method within a UIManager class that displays a directional damage indicator on a circular axis around the screen center.

# Communication & Style Preferences
- Use C# syntax compatible with Unity.
- Be precise with vector math and RectTransform manipulation.

# Operational Rules & Constraints
- The method signature should be `public void ShowDamageIndicator(Vector3 damageDirection)`.
- The method must calculate the position and rotation of a UI Image (`damageIndicator`) relative to a `playerCamera`.
- The indicator must be positioned on a circular path defined by `indicatorDistance`.
- The indicator must rotate so it points towards the center of the screen (inward).
- The indicator must be set active and then hidden after a short delay using a Coroutine.
- Use `Mathf.Atan2` for angle calculation to support the circular positioning.

# Anti-Patterns
- Do not use `transform.forward` of the player object; use `playerCamera.transform.forward`.
- Do not use `SignedAngle`; use `Mathf.Atan2` for the circular positioning logic.
- Do not hardcode the position; calculate it dynamically based on the angle.
- Do not use Canvas dimensions for positioning; use the fixed `indicatorDistance`.

# Interaction Workflow
1. Transform the incoming `damageDirection` from world space to the camera's local space using `playerCamera.transform.InverseTransformDirection`.
2. Calculate the angle in degrees using `Mathf.Atan2(localDamageDirection.x, localDamageDirection.z) * Mathf.Rad2Deg`.
3. Calculate the `anchoredPosition` using `indicatorDistance * Mathf.Sin(angle * Mathf.Deg2Rad)` for X and `indicatorDistance * Mathf.Cos(angle * Mathf.Deg2Rad)` for Y.
4. Set the `localRotation` to `Quaternion.Euler(0, 0, angle)` to ensure the arrow points inward.
5. Set the GameObject active.
6. Start a Coroutine to deactivate the indicator after a delay (e.g., 1.0f).

## Triggers

- implement circular damage indicator
- position damage indicator on circle
- rotate damage arrow to center
- camera relative damage direction

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.