Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.Moveable_PickUp Class Reference
Inheritance diagram for AC.Moveable_PickUp:
AC.DragBase AC.iActionListAssetReferencer AC.Moveable

Public Member Functions

override void UpdateMovement ()
override void Grab (Vector3 grabPosition)
 Attaches the object to the player's control. More...
override void LetGo (bool ignoreInteractions=false)
override bool CanToggleCursor ()
override void ApplyDragForce (Vector3 force, Vector3 _screenMousePosition, float _distanceToCamera)
 Applies a drag force on the object, based on the movement of the cursor. More...
void UnsetFixedJoint ()
void OverrideMoveToPosition (Vector3 newPosition)
 Causes the object's target position to be overridden when held More...
void ClearMoveOverride ()
Vector3 GetWorldMousePosition ()
bool ReferencesAsset (ActionListAsset actionListAsset)
List< ActionListAssetGetReferencedActionListAssets ()
- Public Member Functions inherited from AC.DragBase
virtual void _FixedUpdate ()
bool IsOn (bool accountForCamera=false)
void TurnOn ()
void TurnOn (bool manualSet)
 Makes the object interactive. More...
void TurnOff ()
void TurnOff (bool manualSet)
 Disables the Hotspot. More...
virtual void DrawGrabIcon ()
bool CanGrab ()
bool IsOnScreen ()
 Checks if the the point of contact is visible on-screen. More...
bool IsCloseToCamera (float maxDistance)
 Checks if the point of contact is close enough to the camera to continue being held. More...
bool PlayerIsWithinBoundary ()
 Checks if the Player is within the draggables's interactableBoundary, if assigned. More...
Vector3 GetGrabPosition ()
 Gets the point of contact on the object, once grabbed. More...
- Public Member Functions inherited from AC.Moveable
void StopMoving ()
bool IsMoving (TransformType transformType)
bool IsMoving ()
void EndMovement ()
void Move (Vector3 _newVector, MoveMethod _moveMethod, bool _inWorldSpace, float _transitionTime, TransformType _transformType, bool _doEulerRotation, AnimationCurve _timeCurve, bool clearExisting)
 Moves the GameObject by referencing a Vector3 as its target Transform. More...
void Move (Marker _marker, MoveMethod _moveMethod, bool _inWorldSpace, float _transitionTime, AnimationCurve _timeCurve)
 Moves the GameObject by referencing a Marker component as its target Transform. More...
MoveableData SaveData (MoveableData saveData)
 Updates a MoveableData class with its own variables that need saving. More...
void LoadData (MoveableData saveData)
 Updates its own variables from a MoveableData class. More...
Vector3 GetTargetPosition ()

Public Attributes

bool allowRotation = false
float breakForce = 300f
bool allowThrow = false
float chargeTime = 0.5f
float pullbackDistance = 0.6f
float throwForce = 400f
bool autoSetConstraints = true
float maxAngularVelocity = 7f
float maxDistance = 1f
float minDistance = 0.2f
ActionListSource actionListSource = ActionListSource.InScene
Interaction interactionOnGrab
Interaction interactionOnDrop = null
ActionListAsset actionListAssetOnGrab = null
ActionListAsset actionListAssetOnDrop = null
int moveParameterID = -1
int dropParameterID = -1
float initialLift = 0.05f
- Public Attributes inherited from AC.DragBase
InteractiveBoundary interactiveBoundary
_Camera limitToCamera = null
bool invertInput = false
float maxSpeed = 200f
float playerMovementReductionFactor = 0f
float playerMovementInfluence = 1f
bool allowZooming = false
float zoomSpeed = 60f
float minZoom = 1f
float maxZoom = 3f
float rotationFactor = 1f
bool showIcon = false
int iconID = -1
AudioClip moveSoundClip
AudioClip collideSoundClip
float slideSoundThreshold = 0.03f
float slidePitchFactor = 1f
bool onlyPlayLowerCollisionSound = false
bool ignoreMoveableRigidbodies
bool ignorePlayerCollider
bool childrenShareLayer
OffScreenRelease offScreenRelease = OffScreenRelease.GrabPoint
Sound moveSound
- Public Attributes inherited from AC.Moveable
bool predictCollisions

Protected Member Functions

override void Awake ()
override void Start ()
new void Update ()
void LateUpdate ()
void OnCollisionEnter (Collision collision)
void RunInteraction (bool onGrab)
void ChargeThrow ()
void ReleaseThrow ()
void SetRotationMode (bool on)
void UpdateFixedJoint ()
new void UpdateZoom ()
float GetAlignedDistance (Vector3 screenMousePosition)
- Protected Member Functions inherited from AC.DragBase
override void OnEnable ()
override void OnDisable ()
void OnCollisionExit (Collision collision)
void OnSwitchCamera (_Camera oldCamera, _Camera newCamera, float transitionTime)
void LimitToActiveCamera (_Camera _camera)
void PlaceOnLayer (int layerName)
void BaseOnCollisionEnter (Collision collision)
void PlayMoveSound (float speed)
void UpdateZoom ()
void LimitZoom ()
CursorIconBase GetMainIcon ()
void LimitCollisions ()
- Protected Member Functions inherited from AC.Moveable
void Update ()
void Kill ()

Protected Attributes

bool isChargingThrow = false
float throwCharge = 0f
float chargeStartTime
bool inRotationMode = false
float originalDistanceToCamera
Vector3 worldMousePosition
Vector3 deltaMovement
LerpUtils.Vector3Lerp fixedJointLerp = new LerpUtils.Vector3Lerp ()
- Protected Attributes inherited from AC.DragBase
bool isHeld = false
Transform grabPoint
float distanceToCamera
float speedFactor = 0.16f
float originalDrag
float originalAngularDrag
int numCollisions = 0
CursorIconBase icon
Sound collideSound
bool isOn = true
- Protected Attributes inherited from AC.Moveable
float positionChangeTime
float positionStartTime
AnimationCurve positionTimeCurve
MoveMethod positionMethod
Vector3 startPosition
Vector3 endPosition
bool inWorldSpace
float rotateChangeTime
float rotateStartTime
AnimationCurve rotateTimeCurve
MoveMethod rotateMethod
bool doEulerRotation = false
Vector3 startEulerRotation
Vector3 endEulerRotation
Quaternion startRotation
Quaternion endRotation
float scaleChangeTime
float scaleStartTime
AnimationCurve scaleTimeCurve
MoveMethod scaleMethod
Vector3 startScale
Vector3 endScale
Char character
Rigidbody _rigidbody
Rigidbody2D _rigidbody2D

Additional Inherited Members

- Properties inherited from AC.DragBase
bool IsHeld [get]
- Properties inherited from AC.Moveable
Rigidbody Rigidbody [get]
Transform Transform [get]

Detailed Description

Attaching this component to a GameObject allows it to be picked up and manipulated freely by the player.

Member Function Documentation

◆ ApplyDragForce()

override void AC.Moveable_PickUp.ApplyDragForce ( Vector3  force,
Vector3  mousePosition,
float  distanceToCamera 

Applies a drag force on the object, based on the movement of the cursor.

forceThe force vector to apply
mousePositionThe position of the mouse
distanceToCameraThe distance between the object's centre and the camera

Reimplemented from AC.DragBase.

◆ CanToggleCursor()

override bool AC.Moveable_PickUp.CanToggleCursor ( )

If True, 'ToggleCursor' can be used while the object is held.

Reimplemented from AC.DragBase.

◆ ClearMoveOverride()

void AC.Moveable_PickUp.ClearMoveOverride ( )

Clears any override set by the OverrideMoveToPosition function

◆ GetWorldMousePosition()

Vector3 AC.Moveable_PickUp.GetWorldMousePosition ( )

Returns the position of the cursor that's dragging the PickUp in world-space

◆ Grab()

override void AC.Moveable_PickUp.Grab ( Vector3  grabPosition)

Attaches the object to the player's control.

grabPositionThe point of contact on the object

Reimplemented from AC.DragBase.

◆ LetGo()

override void AC.Moveable_PickUp.LetGo ( bool  ignoreInteractions = false)

Detaches the object from the player's control.

Reimplemented from AC.DragBase.

◆ OverrideMoveToPosition()

void AC.Moveable_PickUp.OverrideMoveToPosition ( Vector3  newPosition)

Causes the object's target position to be overridden when held

newPositionThe new position

◆ UnsetFixedJoint()

void AC.Moveable_PickUp.UnsetFixedJoint ( )

Unsets the FixedJoint used to hold the object in place

◆ UpdateMovement()

override void AC.Moveable_PickUp.UpdateMovement ( )

Called every frame by StateHandler.

Reimplemented from AC.DragBase.

Member Data Documentation

◆ actionListAssetOnDrop

ActionListAsset AC.Moveable_PickUp.actionListAssetOnDrop = null

The ActionListAsset to run whenever the object is let go by the player (and actionListSource = ActionListSource.AssetFile)

◆ actionListAssetOnGrab

ActionListAsset AC.Moveable_PickUp.actionListAssetOnGrab = null

The ActionListAsset to run whenever the object is grabbed by the player (and actionListSource = ActionListSource.AssetFile)

◆ actionListSource

ActionListSource AC.Moveable_PickUp.actionListSource = ActionListSource.InScene

Where to locate interactions

◆ allowRotation

bool AC.Moveable_PickUp.allowRotation = false

If True, the object can be rotated

◆ allowThrow

bool AC.Moveable_PickUp.allowThrow = false

If True, the object can be thrown

◆ autoSetConstraints

bool AC.Moveable_PickUp.autoSetConstraints = true

If True, then Rigidbody constraints will be set automatically based on the interaction state

◆ breakForce

float AC.Moveable_PickUp.breakForce = 300f

The maximum force magnitude that can be applied by the player - if exceeded, control will be removed

◆ chargeTime

float AC.Moveable_PickUp.chargeTime = 0.5f

How long a "charge" takes, if the object cen be thrown

◆ dropParameterID

int AC.Moveable_PickUp.dropParameterID = -1

The parameter ID to set as this object in the interactionOnDrop / actionListAssetOnDrop ActionLists

◆ initialLift

float AC.Moveable_PickUp.initialLift = 0.05f

The lift to give objects picked up, so that they aren't touching the ground when initially held

◆ interactionOnDrop

Interaction AC.Moveable_PickUp.interactionOnDrop = null

The Interaction to run whenever the object is let go by the player (and actionListSource = ActionListSource.InScene)

◆ interactionOnGrab

Interaction AC.Moveable_PickUp.interactionOnGrab

The Interaction to run whenever the object is picked up by the player

◆ maxAngularVelocity

float AC.Moveable_PickUp.maxAngularVelocity = 7f

The maximum angular velocity of the Rigidbody, set if allowRotation = true

◆ maxDistance

float AC.Moveable_PickUp.maxDistance = 1f

The minimum distance to keep from the camera

◆ minDistance

float AC.Moveable_PickUp.minDistance = 0.2f

The minimum distance to keep from the camera

◆ moveParameterID

int AC.Moveable_PickUp.moveParameterID = -1

The parameter ID to set as this object in the interactionOnGrab / actionListAssetOnGrab ActionLists

◆ pullbackDistance

float AC.Moveable_PickUp.pullbackDistance = 0.6f

How far the object is pulled back while chargine, if the object can be thrown

◆ throwForce

float AC.Moveable_PickUp.throwForce = 400f

How far the object can be thrown