Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Godot Procedural Recoil

An asset by vishu
The page banner background of a mountain and forest
Godot Procedural Recoil hero image

Quick Information

0 ratings
Godot Procedural Recoil icon image
vishu
Godot Procedural Recoil

This project is a Godot Engine addon that adds class ProceduralRecoil. This new class make easy procedural-recoil creation possible for 3D games. It is available under the terms of the MIT License.Usage:Attach ProceduralRecoil script to a preferred Node.For latest doc: https://github.com/vi4hu/godot-procedural-recoil

Supported Engine Version
4.2
Version String
0.1.0
License Version
MIT
Support Level
community
Modified Date
9 months ago
Git URL
Issue URL

Godot Procedural Recoil

Godot port of Gilbert's procedural recoil system for Unity

This project is a Godot Engine addon that adds class ProceduralRecoil. This new class make easy procedural-recoil creation possible for 3D games. It is available under the terms of the MIT License.

Installation

Method One:

  1. Search "Godot procedural recoil" in the AssetLib
  2. Download and Install

Method Two:

  1. Clone this repo or download as zip from matching branch
  2. Copy/Move the res://addons/procedural-recoil directory to your res://addons directory

Uninstallation

  • Make sure you have removed all the attached ProceduralRecoil scripts from Scenes.
  • Delete the res://addons/procedural-recoil directory from your project. Make sure to delete it using the Godot editor instead of your default file system program.

Usage

Attach ProceduralRecoil script to a preferred Node.

README Scene Hierarchy of the player In the screenshot above, the Head node is rotated by mouse input and recoil.gd is attached to the CameraRecoil node.

Procdural Recoil Parameters

Recoil: Rotation vector added to the target rotation whenever recoilFire() is called

Aim Recoil: Rotation vector added to the target rotation whenever recoilFire(true) is called

Snappiness: Rate at which the current rotation lerps to the target rotation

Return Speed: Rate at which the target rotation returns to (0, 0, 0)

Functions

recoilFire(isAiming : bool = false)

  • Adds rotation vector to the target rotation, which vector is added is determined by isAiming

setRecoil(newRecoil : Vector3)

  • Sets the recoil vector to newRecoil

setAimRecoil(newRecoil : Vector3)

  • Sets the aim recoil vector to newRecoil

Current Issues

Extremely small z-axis rotations are applied to the rotation, even when the z-axis value of the recoil vector is set to 0. The fix for this issue is to manually set global_rotation.z of the node to 0 every frame.

Make sure to change this if you don't want this rotation to be overridden.

Credits

This project is a Godot Engine addon that adds class ProceduralRecoil. This new class make easy procedural-recoil creation possible for 3D games. It is available under the terms of the MIT License.

Usage:
Attach ProceduralRecoil script to a preferred Node.

For latest doc: https://github.com/vi4hu/godot-procedural-recoil

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Godot Procedural Recoil icon image
vishu
Godot Procedural Recoil

This project is a Godot Engine addon that adds class ProceduralRecoil. This new class make easy procedural-recoil creation possible for 3D games. It is available under the terms of the MIT License.Usage:Attach ProceduralRecoil script to a preferred Node.For latest doc: https://github.com/vi4hu/godot-procedural-recoil

Supported Engine Version
4.2
Version String
0.1.0
License Version
MIT
Support Level
community
Modified Date
9 months ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers