Coder Social home page Coder Social logo

advaned_procedural_animation's Introduction

Spider Procedural Animation Project

Overview

This project implements a procedural animation system for a spider character in Unity.

Features

  • Procedural Leg Movement: Automatic calculation and adjustment of each leg's position to simulate walking, based on the spider's velocity and the terrain underneath.
  • Dynamic Body Orientation: Adjusts the spider's body orientation according to the positions of its legs and the surface normals of the ground.
  • Customizable Settings: Allows tweaking of various parameters such as step size, animation smoothness, and leg padding through the Unity Inspector to fine-tune the animation.

Configuration

Leg Animation Settings

  • Step Trigger Distance: The minimum distance a leg must move before initiating a step.
  • Animation Smoothness: The number of frames over which to smooth the stepping animation.
  • Step Lift Height: The height each leg lifts off the ground during a step.
  • Ground Detection Radius: Radius of the sphere cast used to detect the ground beneath each leg.
  • Ground Detection Depth: How far beneath the spider to cast rays for ground detection.
  • Leg Padding: Additional spacing applied between the front and back legs to avoid collision.

Body Orientation Settings

  • Adjust Orientation: Whether to dynamically adjust the spider's body orientation based on leg positions and ground normal.

Usage

  1. Attach the SpiderController.cs to an Empty GameObject
  2. Attach the SpiderProceduralAnimation script to your spiders body (child of GameObject with SpiderController.cs).
  3. Assign the Leg Target Transforms in the Inspector by dragging the corresponding objects from your scene.
  4. Configure the Leg Animation Settings and Body Orientation Settings as desired.
  5. Put the Spider on the Ingnore Raycast Layer
  6. Play your scene.

Gizmos

For debugging and visual assistance, gizmos are provided to visualize the target positions of each leg and the direction of velocity. Ensure that Gizmos are enabled in the Unity Inspector to view these.

Screenshots

image

advaned_procedural_animation's People

Contributors

mmarco02 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.