playMaker

Author Topic: Limit Object Movement  (Read 770 times)

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Limit Object Movement
« on: July 11, 2020, 07:18:53 AM »
Hello !

Working on Zombie Defense game. To look around map, I placed a empty object on center of map and added get axis and set velocity to move around. and Use Smooth Follow Action on camera and set that center empty object as Target.

What is want is, I wanna limit camera's movement. Only can look within certain radius / distance from center (0,0,0).

Any hints ?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Limit Object Movement
« Reply #1 on: July 14, 2020, 02:49:07 AM »
Hi,

 you can create an FSM where all actions runs in Late Update ( you'll need the advanced versions of some actions on the ecosystem for some math and vector operations)

in that fsm, check the position, clamp it within your radius and set the position back. that's how to constraint effectily.

Bye,

 Jean