Week 7 - Progress of VR Project

We faced huge problems with hitting of the ball, the ball would not go that far with one hit and it usually gets dragged with the club. We tried to solve it, but took a long time and couldn’t figure it out. So, we decided that one of us work on this and the other one work on hand motion.

Sayed:

Task: Hand motion. I watched a tutorial. I downloaded the model object and import it to the project. I created a empty object for my left hand, made a prefab of the model. Rotate it according to VR preview. Each finger needs to be animated. With the animator component I rotate I rotate index, thumb and then other 3 fingers. I created a script that fingers should be moved with the buttons on the controller. 

Dalius:

Task: Solve the glitch with hitting the ball, set ball's max and min speed

After working hard for the solution, we asked Kasper for some help about it. 

We got some advices that we could increase Fixed Timestamp and Set Club Rigibodys Interpolite to Interpolite, but neither of those have worked. 
After 4 days of Googling things, I noticed that there is an option in XR Grab interactable Script, Movement type field, I've made the decision that I need to check this one as well and maybe this will solve our problems. And I was correct! Seems like that there is a bug in Unity (Unity Forum) , so we decided to change it to the Kinematic, that worked perfectly!
Also I want to understand what is this Movement type, I went to unity Documentation field about the Movement types, and Kinematic meant that In Kinematic mode the Rigid Body associated with the interactable will be moved such that the interactable attach point will match the interactor attach point as this is updating the RigidBody, this will appear a frame behind the visual representation of the Interactor / Controller.

And for another task, I had to set the ball's Minimum and maximum speed.


To get the speed of the ball, you had to get a Rigibody , and a velocity of it. And through the Velocity you can access the magnitude, which is the force speed.
In FixedUpdate function, I added some checks, if the ball's magnitude is higher that maxSpeed, I'm setting it to our max speed number.
And there is also another check, if the ball get's to the less speed than the minSpeed is set up, it records ball's lastPosition, and sets the velocity to 0, so that when the ball is returned to it's previous position, it stops moving.




Comments

Popular posts from this blog

Week 2 - Marker based AR

Week 6 - Progress of VR Project

Week 3 - Markerless AR