© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
C. HardmanGame Programming with Unity and C#https://doi.org/10.1007/978-1-4842-9720-9_43

43. Force Fields and Jump Pads

Casey Hardman1  
(1)
West Palm Beach, FL, USA
 

In this chapter, we’ll be implementing a configurable ForceField script that pairs with a trigger collider to apply force to Rigidbodies and/or the player. Based on a variable set in the Inspector determining the type of force to apply, we’ll either apply it constantly while the trigger is touched or once when the trigger is first entered. In other words, based on the force mode you choose, you could make an object either get pushed as if by a large fan, or get shoved up like a “jump pad” thrusting ...

Get Game Programming with Unity and C#: A Complete Beginner’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.