These are chat archives for JScott/cardboard-controls

27th
Jan 2016
Pavlos Nicolaou
@p4vlos
Jan 27 2016 19:02
Hello @JScott ! Is there any way I can change a bit your scripts so I can make the player walk towards when I pull the trigger? and where is this bit? thank you
Justin Scott
@JScott
Jan 27 2016 22:20
@p4vlos absolutely! That was one of the first things I did with CC+ when I first made it :)
I don't have a code example ready to go but I can tell you exactly how to do it
Pavlos Nicolaou
@p4vlos
Jan 27 2016 22:21
thank you so much
what I have to do
?
Justin Scott
@JScott
Jan 27 2016 22:21
I'd probably do something like adding a boolean in the character controller (walking?) that sets to true with CardboardDown and false with CardboardUp
Then in your Update logic, do what you would normally do to move a character: probably adding a force for a rigidbody or just updating the position. The easiest thing is to just move it along the transform.forward of the Cardboard camera. I think Camera.main.transform.forward works?
And wrap that in your boolean
So when the trigger is down from the trigger.OnDown event, which sets the boolean to true, it moves forward exactly like you would for any other game
And then when it comes up, trigger.OnUp flips that boolean off
Make sense?
Pavlos Nicolaou
@p4vlos
Jan 27 2016 22:28
perfect
Justin Scott
@JScott
Jan 27 2016 22:29
That's what I like to hear :)
Pavlos Nicolaou
@p4vlos
Jan 27 2016 22:29
and I will add this to CardboardControlManager ?
Justin Scott
@JScott
Jan 27 2016 22:30
I would add it to your Character Controller directly. In the case of the Demo Scene, I'd put it in ExampleCharacterController.cs
Pavlos Nicolaou
@p4vlos
Jan 27 2016 22:30
okay perfect
Justin Scott
@JScott
Jan 27 2016 22:30
The less you touch stuff in the CardboardControl directory for your game, the easier it'll be to keep up to date as I roll out improvements. That's general good practice for Unity I'd say
Pavlos Nicolaou
@p4vlos
Jan 27 2016 22:30
thank you mate :)
Justin Scott
@JScott
Jan 27 2016 22:31
You're very welcome. It gets lonely in here without people asking questions so don't hesitate to reach out
Pavlos Nicolaou
@p4vlos
Jan 27 2016 22:32
haha
Justin Scott
@JScott
Jan 27 2016 22:33
Oh and totally let me know how using framework is. Unity doesn't give me a lot of ways to see how users are doing unless I pester people for Asset Store ratings
Pavlos Nicolaou
@p4vlos
Jan 27 2016 22:33
I feel you because I am working on 3 different projects and one is this one that I am using Google Cardboard
Yea I will for sure
Justin Scott
@JScott
Jan 27 2016 22:36
And speaking of updates, @/all of you that integrate through the Asset Store (thanks for your support :o ) are getting CC+ v3.5.2 as soon as it gets approved. That's Cardboard SDK v0.6, super helpful Gaze additions, and simple support for the official Google reticle which the base Cardboard SDK makes really difficult to use for some reason.
JScott @JScott slithers back into hibernation until someone has questions