top of page

Nuclear Throne-style Camera Follow and Shake.

  • Jonathan Gorr
  • Aug 31, 2017
  • 1 min read

I've recently been recommended this excellent top-down roguelike shooter, Nuclear Throne, available on Steam. It has a very nice camera shake functionality that I would like to share my Unity3d(C#) recreation of.

Nuclear Throne, Level 1

How [I think] it works

It takes the world or screen position of the player and that of the cursor/mouse, subtracts them then normalizes them to create a 2d vector by which they offset the camera's position on the x and y axes. The intensity of the explosion or gunshot determines the intensity of the displacement.

Here is a standalone version of the shake code:

I also provide below a more complete script that includes target follow functionality.

 
 
 

Comments


Location

Houston, TX USA

Contact

jonathangorr@gmail.com

+1 (754) 423-4462

Follow

  • github

©2023 by Jonathan Gorr.

bottom of page