playMaker

Author Topic: How to control object to not go off screen?  (Read 1462 times)

ryf9059

  • Full Member
  • ***
  • Posts: 100
How to control object to not go off screen?
« on: March 17, 2014, 03:05:11 PM »
Is there a way to keep object in the screen and don't allow it to go off? The screen resolution is adjustable at start, camera is orthographic in this case.

What I can think of now is to sort of create a imaginary box along with camera's orthographic line, and use that to determine if an object has intersect with the boarder, if it did then offset it into the screen.

Or maybe I will just create a wall around that box, so the object can't go off.

Is there any better way?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How to control object to not go off screen?
« Reply #1 on: March 17, 2014, 05:00:20 PM »
Hmm.. A wall/trigger that stops him is the easiest way.

Theres another way to work from the pixel/screen resolution but way more complicated and it's probably not any better than just using a big wall or a trigger than disables the controls or something.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D