Animal Controller
📥 Integrations📑 Changelog✅Social
  • 🤝Welcome to Malbers Animations Assets
  • 🌐Discover all my Assets
  • 💫What's New
  • 🌀Upcoming assets
  • 📋Changelog
  • ↗️Upcoming Changelog
  • 🛣️Road Map
  • ✍️End User Licence Agreement
  • 🌟Features
  • Improve Performance Tricks
  • 😓Know Limitations so far
  • 📥Downloads
  • QuickStart
    • 📖Guide to use All Malbers Assets with (AC)
    • 🔼Upgrade to URP
    • 🔼Upgrade to HDRP
    • 💔Common Issues
    • 🔔Tips and Tricks
  • Guides and Tutorials
  • 📺YouTube Tutorials
    • 📺Video Tutorials (On Queue)
  • 📱Mobile Setup Guide
    • Mobile Joystick
  • 🧐How to: Animal Controller
    • 🔹Play a Mode while Moving
    • 🔹Create and configure a new mode
    • 🔊Adding Sound Effects
    • 🔹Rebone Mesh Tutorial (Skin Mesh is Missing)
    • 🔹Add Movement with Non RootMotion Animations
    • 🔹Fetch a ball
    • 🔹Set up Timeline
    • 🔹Make Animal flee when see the animal Player
    • 🔹Animal Controller for Humanoids
    • Create a Shootable Weapon From Scratch
    • ⚔️How to Fix weapons offset and values (Bow, Pistol)
    • ✨Add a Effect to the Effect Manager
    • 🕹️Connect Inputs to the Controller
    • Modify the controller with a Stat
    • Use the Modify Stat Component
    • 📡Use a MEvent and MEvent Listeners
    • 💎Change from Faceted to Smooth poly art Animals
    • ⁉️Listen when an Mode starts or ends
  • 🐎How to: Horse Animset Pro
    • 🐴Call the Mount
    • 🤠Change Meshes for the Rider
    • 🏇Make any animal mountable
  • 🕺Strafing
  • Main Components
    • 🐺MAnimal Controller
      • General
        • Pivots
      • Speeds
      • 🔷States
        • 🕴️Idle
        • 🏃‍♂️Locomotion
        • 🌠Fall
        • 🤾‍♀️Basic Jump
        • 🤾‍♂️Root Motion Jump
        • 🐟Swim
        • 🐊UnderWater
        • 🧗‍♂️Climb
        • 🧗‍♂️Ledge Grab
        • 🦅Fly
        • 🪂Glide
        • 🧗Wall Run
        • 🧗Wall Run Vertical
        • ⛷️Slide
        • ☠️Death
        • ☠️Death Ragdoll
        • 🆕Creating a new State
      • 🟩Modes
        • 🟩Mode Behavior
        • 🟩Mode Sequence
      • 🅾️Stances
      • Advanced
      • Animal Modifiers
      • Events
      • Debug
      • Animal Animator Behaviors
      • Methods and Properties
    • 🎮Malbers Input & MInput
      • Methods and Properties
    • 🤖AI
      • AI Animal Control
      • MWayPoint
      • Wander Area
      • AI Target
      • Animal Brain
        • AI States
        • Tasks
          • General - Chance
          • General - Empty
          • General - Invoke Event
          • General - Send Message
          • General - Play Audio
          • General - Quick Align
          • General - Reaction
          • General - Set Look At Aim
          • General - Set Stat
          • General - Wait
          • Animal - Set Speed
          • Animal - Play Mode
          • Animal - Set/Play State
          • Animal - Set Stance
          • Animal - Set Strafe
          • Movement - Move Stop
          • Movement - Patrol
          • Movement - Set Destination
          • Movement - Set Target
          • Variables - Set Var Listener
          • Weapons - Weapon Tasks
        • Decisions
          • General - AND
          • General - Check Stat
          • General - Compare Stats
          • General - Look
          • General - OR
          • General - Is Task Done?
          • General - Wait
          • Movement - Has Arrived
          • Movement - Check Target
          • Animal - Check Mode
          • Animal - Check Stance
          • Animal - Check State
          • Variables - Check Scriptable Variable
          • Variables - Check Transform Var
          • Variables - Check Var Listener
          • Runtime Set - Is Target in Runtime Set
      • 📌Point Click
    • 🧨Reactions
    • 📶Combo Manager
    • ⚔️Weapon Manager
      • 🛡️MWeapon [General] Properties
      • 🛡️MWeapon [Damage] Properties
      • 🛡️MWeapon [IK] Properties
      • ⚔️MMelee
      • 🔫MShooteable
      • 🏹Bow
    • 〰️Path Constraint
      • 〰️MPath
      • 〰️Path Link (Straight)
      • 〰️Path Link (Cinemachine Path)
      • 〰️Path Creator(Sebastian Lague)
    • Speed Ground Changer
  • Scriptable Architecture
    • 💠Scriptables
      • 🔹Bool Var
      • 🔹Int Var
      • 🔹Float Var
      • 🔹String Var
      • 🔹ValueToString
      • 🔢Variable Listeners & Comparers
      • 🔰IDs
      • 🎫Tags
      • 🪝Transform Hook
      • 📣MEvents
      • 📣MEvent Listener
      • 📦Runtime gameobjects
    • 🔤MLocal Variables
  • Secondary Components
    • ⚔️MDamager
      • 🐾MAttack Trigger
      • 🐾Attack Trigger Behavior
      • 🏉MProjectile
      • 🏹Projectile Thrower
      • 🤯MExplosion
    • 🤕MDamageable
    • 🧊Zones
      • Public Methods
    • ✊Pick Up - Drop
    • ✊Pickable
    • 🚩Respawner
    • 🚩Respawner NPC
    • 🚩Simple Respawner
    • 🏁CheckPoint
    • IK Manager
      • IK Processors
      • Weight Processors
  • Global Components
    • 🧡Stats
      • 🔸Stat Modifier
      • 🔸Modify Stat <Component>
      • 🔸Modify Stat <Asset>
      • 👨‍💻Public Methods
    • Animator Behaviours
      • Message Behaviour
      • Random Behaviour
      • Is Kinematic Behaviour
      • Sound Behaviour
      • Rigid Constraint Behaviour
    • 🟩Trigger Proxy
    • 🔌Interactable
    • ⚡Interactor
    • ⁉️Conditions
    • 🎥Free Look Camera
    • 🎥Cinemachine
    • UI
      • Unity Utils
  • Riding System (HAP)
    • Horse Animset Pro (HAP) Riding System
    • The Art of (HAP)
    • Mount
      • Methods and Properties
    • MRider
      • Methods and Properties
    • Mount Triggers
    • Mount Points
  • Utilities
    • Material Changer
    • Active Meshes
    • Effect Manager
    • Effect Behavior
    • Animator Event Sounds
    • Blend Shapes
      • Blend Shape Preset
    • Look At
    • 🏹Aim
    • 🎯Aim Target
    • 🎯Lock On Target
    • 🐾Steps Manager
    • 🐾Step Trigger
    • 🔗Mode Align
    • 🔗Aligner
    • Component Selector
    • MAnimalAnimatorSync
    • Multiple Time Checker
    • MAnimalAnimatorSync
  • Annex
    • 🗃️Integrations
      • General HAP Integration
      • Rewired
      • Invector Templates
        • Invector Weapon Settings
      • Animals Controller + Invector
      • Ootii's Motion Controller
      • Opsive Ultimate Character Controller (UCC 3.03)
      • Opsive Ultimate Character Controller (UCC 3.08) Generic
      • AStar Pathfinding
      • Unity Input System (NEW)
        • New Input Link [Old Versions]
      • Game Creator
      • Game Kit Controller
    • Contact
    • 🤔FAQ
    • Refund Policy
  • Games using Malbers Animations
  • Interfaces
    • IAITarget
    • IWayPoint
    • IAIControl
    • IAim
    • IAlign
    • IGravity
    • IInteractor
  • ULTIMATE SELECTOR
    • Overview
    • Selector Manager
    • Selector Editor
    • Selector Controller
    • Selector Item
    • Selector UI
    • Selector Data
    • Changelog (Selector)
  • 🎒Malbers Inventory Add-On
    • Overview
      • Compatibility Matrix
      • Roadmap
      • Update Notes
  • Updating from v1.1.1 to v1.2 Instructions
  • Basic Setup Instructions
    • Creating a new Item
      • Adding Buffs/Debuffs to Items
      • Setting up Item Reactions
      • Custom Rarities
    • Setting up Item/Inventory Types
    • Set up the Pick/Drop Component
    • Setting up the Notifications
    • Setting up the Item Info panel
  • Inventory Set
    • Events
  • Inventory Master
  • Notification Manager
    • Notification Child
    • Events
  • Save/Load System
  • Item Spawner
  • Storage Chests
    • Chest Inventory
    • Chest Inventory UI
  • Using Armour
  • Shop System
    • Shop
    • Shop UI Manager
  • Cooking System
    • Create a new Recipe
  • UI Manager
  • Hotbar
Powered by GitBook
On this page
  • How it works
  • Creating the Swim State
  • Priority
  • Common State Properties
  • Tag Modifiers
  • Requirements
  • Animator
  • Speed Set
  • Swim Parameters
  • Water Layer
  • Align Smooth
  • Bounce
  • Try Exit Time
  • Water is Static
  • Keep Inertia
  • Radius

Was this helpful?

  1. Main Components
  2. MAnimal Controller
  3. States

Swim

1.4.2c

PreviousRoot Motion JumpNextUnderWater

Last updated 1 year ago

Was this helpful?

The Swim state is in charge of allowing the character to swim on water. Its State is 4.

In version 1.4.2c+ and above, the swim state can be used with mesh colliders.

In order to make it work you need to disable all water layer interaction in the Collision Matrix.

How it works

The swim state uses colliders to know when the animal is inside a Water trigger with the Layer "Water".

A sphere cast is called in a given interval to find if the character is inside that trigger. If that condition is met then the State will be activated.

Creating the Swim State

To create a new Swim State Click the Plus button on the States list:

Or just duplicate any of the already created Swim States Assets of any animal you own and drag it to the States List.

Priority

Common State Properties

The basic setting for the Water states are very similar for all the animals

  • ID = Swim State ID

  • Input: None (This State is activated automatically when entering a source of water)

  • General

    • RootMotion = True

    • Sprint = true

    • Gravity = false

    • Grounded = false

    • Custom Rotation = true

    • Orient to Ground = false

    • Ignore Lower States = true

    • Persistent = false

    • Lock Movement = false

    • Lock Input = false

    • Additional Position Speed = true

  • Exit Frame = true

  • Sleep From State = 0

  • Sleep from Mode = 0

  • Queue From = 0

  • Tag Modifiers = 1

    • Swim Enter

Tag Modifiers

The Swim State has a “Swim Enter” Tag Modifier by default. This allows the swim state to have an entering animation before entering the swim animation and allows you to modify common parameters on the State while it is playing the Enter Water Animation.

If your character does not have the Enter Water Animation this can be ignored.

The values for the Animal parameters that the Swim Enter modify are:

Requirements

This pivot will be used as the position to find a water source, a Gameobject set in the Layer: Water.

The water pivot also acts like the water level position. if it is higher it will sink more the animal, if it is lower it will make it stay higher in the water.

Here's the difference between the Height (Y Position) of the Water pivot

Animator

The Swim state requires Animation States that are in charge of the Swim movement.

All states have a core animation state. For swim is a swim blend tree with the Tag Swim.

Since the Swim is a moving state the Speed Multiplier must be set as Parameter "SpeedMultiplier"

You can take a look to the Wolf Lite Animator (Swim State) as a guide to see how is set up:

Speed Set

Swim Parameters

Water Layer

Layer used to search which gameobject is set as water.

Align Smooth

Lerp value for the animal to stay aligned to the water level. Higher values will align to the surface faster. (Img)

Bounce

When entering the water, the Animal will sink for a while. Higher values will return to the surface faster.(Img)

Try Exit Time

If the Animal Enters it will wait this time before trying to exit the water. This avoids unwanted entering/exiting the swim state in the same fotogram.

Water is Static

Means the Water does not change the shape. Enable this when your water is always an horizontal plane. This avoids unnecessary raycasting and increases performance.

Keep Inertia

Gives an extra impulse when entering the state using the accumulated inertia from the last State.

(Img)

Radius

Spherecast radius to find water using the Water Pivot Position.

(Img)

The state should have a higher priority than , and .

If you want your Character to jump while in the water: should be above Swim on the State list

The state needs a called Water in order to work. To create a new Pivot simply increase the pivot Array size

The Swim need a new that affect the Swim State

If your swim animations are NOT RootMotion then you need to increase the and values to be greater than zero

🐺
🔷
🐟
Idle
Locomotion
Fall
Jump
pivot
Speed Set
ID
Position
Rotation
Disable the Layer Collision matrix (Water) in the Project settings.
Left: Y = 0.3 Right: Y = 0.4
Its Transition condition is State = 4