playMaker

Author Topic: Freezing Position  (Read 2700 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Freezing Position
« on: February 01, 2015, 05:59:40 AM »
Is it really not possible to only freeze position x of the player without unfreeze all the other positions and rotations?

I use set property on the rigidbody on my player. And then constraints and freeze position x, but then it also unfreeze position y and z and rotation x, y and z.
I don't want that. Finally I figured out how to make the player falling straight down to just freeze position x, but my happiness was over when the player started to rotate or fall out of the level in the z-axis when I pushed objects.

So, is it a way to freeze position x and still keep the other positions and rotation as it is?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Freezing Position
« Reply #1 on: February 01, 2015, 11:43:23 PM »
Correct me if I'm wrong, but you want a object to not move on X,Y,Z constraints in order to push, pull, or drop the item?

If that's the case, that is a problem I'm having right now as well.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Freezing Position
« Reply #2 on: February 02, 2015, 07:02:46 AM »
Solved this on Skype.

Rigidbody Constraints when defined are done so explicity for the entire constraints group. So when you set constraits.freezepositionx you actually lock the X and unfreeze everything else. In scripting you would define multiples with the bitwise operator ( | ) but can't do that with set property and the other freeze options did not fit the circumstances.

In the end, this was not a good option for trying to do what was needed so using gravity and disabling inputs was used instead.

That sums this topic up, Rabagast if you have trouble with the other solution please make a new topic =)
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D