🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🔧 AI Nachrichten ChatGPT automatically logged out [Fix](12.09.2026 um 17:09 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
🪟 Windows TippsServertimeout in Outlook über 10 Minuten verlängern(12.09.2026 um 15:10 Uhr)
🕵️ SicherheitslückenCVE-2026-11736 | NETGEAR XR1000v2 input validation(13.09.2026 um 03:22 Uhr)
🕵️ SicherheitslückenCVE-2026-11734 | NETGEAR RAX54Sv2 buffer overflow(13.09.2026 um 03:22 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🔧 AI Nachrichten ChatGPT automatically logged out [Fix](12.09.2026 um 17:09 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
🪟 Windows TippsServertimeout in Outlook über 10 Minuten verlängern(12.09.2026 um 15:10 Uhr)
🕵️ SicherheitslückenCVE-2026-11736 | NETGEAR XR1000v2 input validation(13.09.2026 um 03:22 Uhr)
🕵️ SicherheitslückenCVE-2026-11734 | NETGEAR RAX54Sv2 buffer overflow(13.09.2026 um 03:22 Uhr)

🔧 Programmierung 🕛 vor 2 Jahren 8 Min Lesezeit
0

From Code to Game: My Unity Adventure

↗ Quelle (dev.to)
🗣️ Stimme:

As a software engineer, I've always been fascinated by the intricate world of game development. Despite my experience in coding, stepping into this realm felt like opening a door to an entirely new universe. This blog aims to share my journey as a beginner in Unity game development, along with some initial tips and tricks I've picked up along the way.



Why would I make a video game when I can just play them?



I have been playing video games as long as I can remember. I have always used them as a release from stress and anxiety, but its also how I met some of my best friends. Countless nights of staying up late on a variety of games, weekends of competing in fps (first person shooter) tournaments, and even hosting LAN parties at my house.





How does Unity handle player movement?



Unity offers various methods for handling movement inputs, including Transform, Rigidbody, and CharacterController. For my project, I am utilizing Rigidbody. Below are some examples of Rigidbody methods essential for the PlayerMovement script:



Update() Handles input for movement (WASD keys) and call the RotateTowardsMouse method to rotate the player towards the mouse position.




CODE
void Update()
{
movement.x = Input.GetAxis('Horizontal');
movement.y = Input.GetAxis('Vertical');

RotateTowardsMouse();
}






FixedUpdate() Moves the player based on the movement vector and speed.




CODE
void FixedUpdate()
{
rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);
}






RotateCharacterTowardsMouse() Calculates the angle between the player and the mouse position, then rotates the player to face the mouse.




CODE
void RotateCharacterTowardsMouse()
{
Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Vector2 direction = (Vector2)(mousePosition - transform.position);
float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
rb.rotation = angle;
}






Most components created for the project will require scripts for customization. Note that Unity will automatically update the script as you make changes through the UI.



Once you have created the PlayerMovement script, you can assign it to the player GameObject by dragging and dropping it from the Project window into the Inspector window. Alternatively, you can click the Add Component button in the Inspector window, search for PlayerMovement, and select it.



After configuring the movement, you will be able to move an empty square model around.



Lets add some custom sprites!



Setting up the player and zombie sprites is a fun process that I enjoyed. My friend Joey created the sprites and I was able to build all the surrounding pieces to make them work. I imported the custom sprites for player models, zombies, and scenery into their folder, plugged them in, and worked on setting up idle/running states.





References:



Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Check Point Patches Critical VPN Vulnerabilities
1 Quelle
Ukrainian Conti Ransomware Developer Sentenced to 4 Years in US Prison
1 Quelle
GitLab Vulnerability Exploited One Day After Disclosure
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten From Code to Game: My Unity Adventure

Thematisch verwandte Begriffe: From, Code, Game, Unity · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...