ExtendRealityLtd / VRTK

An example of how to use the Tilia packages to create great content with VRTK v4.
https://www.vrtk.io/
MIT License
3.69k stars 993 forks source link

Disable "Play Space Falling" in VRTK v 3.2.0 #1428

Closed patcamerlengo closed 7 years ago

patcamerlengo commented 7 years ago

Hi!

I'd like to deactivate the function that the headset automatically teleports to the floor if i lean over a ledge. I'm trying for so long now but I don't get where my mistake is. I think in a previously version it was called playspace falling. But now i can't find something like that just disables the snap to the floor.

greets patrick

thestonefox commented 7 years ago

@patcamerlengo have you tried simply removing the body physics script?

The body physics script is what pulls you down to the ground.

patcamerlengo commented 7 years ago

Yes I did. But then, how do i use the height adjust teleport script?

thestonefox commented 7 years ago

You don't need the body physics script to use the height adjust teleport script.

patcamerlengo commented 7 years ago

so i put the height adjust script on the camera rig? and another problem is that i dont see the boundaries of steamvr anymore. the light blue ones. the playarea script of steamvr gets disabled wenn i press play.

thestonefox commented 7 years ago

You shouldn't put any scripts on the camera rig., have you watched the tutorial videos at videos.vrtk.io?

patcamerlengo commented 7 years ago

if i delete the body physics script. height adjust teleport wont work anymore. i made a simple lift. a cube with collider. i teleport on that but without body physics it wont lift me up.

thestonefox commented 7 years ago

the teleporter teleports you around, the body physics script deals with your body and physics.

the teleporter will still work, but things won't lift you up

patcamerlengo commented 7 years ago

yes and thats the problem ;-) how do i achieve it to take an elevator without falling down on ledges.

thestonefox commented 7 years ago

have you tried settings the body physics script to ignore collisions enable body collisions = false and then set the teleport height to really high (or low)

patcamerlengo commented 7 years ago

ok i disabled it. now im falling down. not teleporting. but what do you mean by teleport height?

thestonefox commented 7 years ago

I think what you're trying to achieve isn't going to work for you anyway.

On one hand you want to use Unity physics to push your camera rig up with other physics objects, but on the other hand you don't want Unity physics to pull you down to the ground (unless of course you're on an elevator)

There is a Fall Restriction option on the Body Physics script where if you have either controller over the existing ground then you don't fall. It could potentially have another option that was Never Fall maybe, I'll look into it.

patcamerlengo commented 7 years ago

ok thx. i understand.

thestonefox commented 7 years ago

Ok an Always Restrict option seems like a good idea. i'll have a PR up in a few moments (it will be going into the version 3.3.0-alpha branch but you can swipe the code if you need to)

thestonefox commented 7 years ago

Actually even an Always Restrict option would not allow you to move down with elevators.

Your other alternative is to child your play area to the elevator game object when you're in the elevator. Or use the TransformFollow script (which is probably a better idea).

thestonefox commented 7 years ago

Here's the commit https://github.com/thestonefox/VRTK/pull/1429/commits/35952630bc206909cc3ebe6ea912f1728b3d9f6e

in this PR that adds the Always Restrict option

https://github.com/thestonefox/VRTK/pull/1429