Magnet


Declaration

public sealed class Magnet : MonoBehaviour

Description

An object that produces a magnetic field that attracts objects.

Properties

magneticFieldThe sphere collider that represents the magnetic field of the magnet (Read only).
strengthThe strength of the magnet. If an object is within multiple magnetic fields, then it will be attracted to the magnet with the higher strength.
radiusThe radius of the magnetic field produced by the magnet. Magnetic objects within the radius are attracted to the magnet.