For the complete documentation index, see llms.txt. This page is also available as Markdown.

🏃‍♂️Pet Movement & Follow System

🏃Pet Movement & Follow System

📋 Overview

The Pet Movement & Follow System gives you complete control over how pets follow players. The system dynamically adjusts pet speed based on player movement (walking, running, sprinting), preventing pets from falling behind and includes smart teleportation for stuck situations.

Perfect for:

  • 🏃 Ensuring pets always keep up with players

  • 🎮 Creating realistic pet following behavior

  • ⚡ Preventing pets from getting lost or stuck

  • 🎨 Customizing pet speed for different gameplay styles

  • 🔧 Optimizing server performance with configurable update intervals


✨ Key Features

Feature

🎯 Dynamic Speed Adjustment

Description

Pet speed automatically adapts based on player movement state (walking/running/sprinting)

Feature

🚀 Smart Teleportation System

Description

Automatically teleports pets to players when they get too far away, preventing permanent separation

Feature

⚙️ Performance Optimization

Description

Configurable update intervals allow balancing between responsiveness and server performance

Feature

🔄 Full Backward Compatibility

Description

Works seamlessly with existing pet systems without requiring migration

Feature

🎨 Visual Quality Controls

Description

Built-in limits prevent animation glitches while allowing extreme speeds for special use cases

Feature

📏 Distance-Based Intelligence

Description

Speed boost only activates when pets are far enough, preventing unnatural close-range behavior

Complete Feature List

  • ✅ Dynamic Speed Multipliers – Three-tier speed system (walking/running/sprinting)

  • ✅ Real-Time Speed Detection – Automatically detects player movement state

  • ✅ Distance-Based Activation – Speed boost only when pet is far enough

  • ✅ Smart Teleportation – Auto-teleport when pet exceeds maximum distance

  • ✅ Ground Detection – Teleport finds valid ground coordinates

  • ✅ Animation Preservation – Speed limits prevent animation desync

  • ✅ Configurable Performance – Adjustable update intervals for optimization

  • ✅ Thread Management – Automatic cleanup when changing pet states

  • ✅ Ownership Handling – Maintains network ownership during follow


🎮 How to Configure

Accessing Configuration

File Location:

Configuration Section:

🚶 Base Speed Multiplier

Applied when: Player is walking normally Default Value: 1.8 Technical Range: 0.0 - 10.0 Recommended Range: 1.5 - 2.5 Visual Quality Limit: 3.0

What it does:

  • Controls pet speed when you're walking at normal pace

  • Value of 1.8 means pet moves 1.8x faster than default NPC speed

  • Lower values make pets more relaxed but may lag slightly behind

  • Higher values make pets more eager but can look rushed


🏃 Running Speed Multiplier

Applied when: Player is running (holding Shift) Default Value: 2.2 Technical Range: 0.0 - 10.0 Recommended Range: 2.0 - 3.0 Visual Quality Limit: 4.0

What it does:

  • Controls pet speed when you're running

  • Should be higher than BaseSpeedMultiplier

  • Value of 2.2 ensures pets keep up during normal running

  • Provides smooth transition between walking and sprinting


🏃💨 Sprinting Speed Multiplier

Applied when: Player is sprinting (tapping Shift repeatedly) Default Value: 3.0 Technical Range: 0.0 - 10.0 Recommended Range: 2.5 - 4.0 Visual Quality Limit: 5.0

What it does:

  • Controls pet speed during maximum player speed

  • Highest speed multiplier in the system

  • Value of 3.0 = 3x normal NPC speed

  • ⚠️ Warning: Values above 5.0 cause severe animation glitches


🎯 Minimum Distance for Speed Boost

Default Value: 5.0 meters Range: 0.0 - 50.0 Recommended: 4.0 - 8.0

What it does:

  • Pet only gets speed boost when farther than this distance

  • If closer than this value, pet uses BaseSpeedMultiplier

  • Prevents pets from running frantically when already close

  • Creates more natural close-range behavior

Example:

  • You're walking, pet is 3 meters away → Uses BaseSpeedMultiplier (1.8x)

  • You're running, pet is 7 meters away → Uses RunningSpeedMultiplier (2.2x)


🚀 Maximum Follow Distance (Teleport Trigger)

Default Value: 40.0 meters Range: 10.0 - 500.0 Recommended: 30.0 - 60.0

What it does:

  • When pet exceeds this distance, it teleports to you

  • Prevents pets from getting permanently lost

  • Finds valid ground coordinates automatically

  • Maintains heading (faces same direction as player)

Use Cases:

  • Lower values (25-35): More frequent teleports, safer for complex maps

  • Higher values (50-80): Fewer teleports, pets run longer distances

  • Very high (100+): Minimal teleports, only for stuck situations


⏱️ Speed Update Interval

Default Value: 300 milliseconds Range: 50 - 5000 Recommended: 200 - 500

What it does:

  • How often the system checks and updates pet speed

  • Lower = More responsive but higher CPU usage

  • Higher = Less responsive but better performance

Performance Guide:

Value
Responsiveness
Performance
Use Case

100ms

Instant

High CPU

Small servers (<32 players)

300ms

Fast

Balanced

Recommended for most servers

500ms

Normal

Low CPU

Large servers (100+ players)

1000ms

Delayed

Minimal CPU

Extreme optimization needed


📍 Enable Smart Teleportation

Default Value: true Options: true or false

What it does:

  • When true: Pet teleports when exceeding MaxFollowDistance

  • When false: Pet keeps running indefinitely (may get stuck/lost)

Recommendation: Keep enabled unless you have custom teleport handling


🔧 Configuration Examples



❓ Frequently Asked Questions (FAQ)

Q2: Do these settings apply to all pets or per-pet?

Answer: These are global settings that apply to all pets on your server. All pets use the same speed multipliers. If you need per-pet customization, you would need custom development.

Q3: Does the system work with leashed pets?

Answer: No, this system only affects the Follow state. Leashed pets use the existing system and are not affected by these settings.

Q4: Will existing pets automatically use this system?

Answer: Yes! This is fully backward compatible. All existing pets will automatically use the new dynamic speed system when following players. No migration needed.

Q5: Can I disable the speed system and use default behavior?

Answer: Yes, set all multipliers to 1.0:

This reverts to default GTA V NPC speed (but pets will lag behind).

Q6: Does teleportation work indoors and in interiors?

Answer: Yes! The system uses GetGroundZFor_3dCoord to find valid ground coordinates, which works in most interiors. However, some custom MLOs may cause issues. If pets teleport into walls, increase MaxFollowDistance to reduce teleport frequency.

Q7: What happens when a pet is in a vehicle?

Answer: The speed system only applies to Follow State. When pets are in vehicles, this system is automatically disabled and cleanup occurs.

Q8: Can I use different speeds for different pet types (dogs vs cats)?

Answer: Not with the default configuration. The system applies globally to all pets.

Q9: Does this affect server performance significantly?

Answer: Minimal impact when properly configured:

  • Each active following pet runs one thread

  • Thread checks distance + applies speed multiplier every UpdateInterval ms

  • Default 300ms = ~3 checks per second per pet

  • 50 active pets = ~150 calculations/second (negligible)

For servers with 100+ simultaneous pets, increase UpdateInterval to 500-1000ms.


Speed Reference Table

Multiplier
Sprint Speed
Description

1.0

Normal

Default GTA V ped speed

2.0

~13 m/s

2x normal speed

3.0

~20 m/s

3x normal speed

5.0

~33 m/s

Animation glitches start

10.0

~66 m/s

Maximum speed, severe glitches


Last updated