Week 11 - Working on project [Progress]
Another week, more tasks to come. As our first week of the project was successful, we split even more tasks to do. This weeks tasks for each of the group member was:
Dalius:
Tasks: Create buttons for Increase/Decrease Fire Rate of the machine, Starting the machine and Create a challenge button.
Description: To how create buttons, I decided to go to YouTube, and see how people are making buttons in VR. I have followed this YouTube video to make a buttons with the press functionality. Link to buttons
After buttons were successfully made, it was time to start working on the functionality of the buttons.
Button was pressed method |
Turret Machine script FireRate |
Machine and button functions |
Also, if there are no objects on the platform, its gonna show to user that you need to place an item on the platform to start the challenge. For the challenge, to make things a bit more interesting, Challenge started at fireRate of 2.0, and within 10 secs of the challenge it increases the speed of the turret.
After the challenge has been done, we are setting the counter of plates shot, and plates that were hit. And some more attributes which are clear enough to understand what it does.
We had some hiccups during the project.
Dalius working on the buttons. I was working on the gun and the
shooting.
The problem we encountered was that when walk to the buttons
and try to press it, the hand would go right through the button and not being
able to press it.
I thought it was easy, just add a collision and it work, but
it didn’t. I added a grab intractable component, this way when you grab it, it
would press the button, but the button would fall off under the table.
We tried everything nothing worked until I saw a tutorial on
physics-Based Hands.
For the hand to be able to interact with buttons and not go
through objects. An empty object must be created, both hands prefabs will be
added to it. and you must manually create capsule objects for each hand.
These prefabs would follow the original prefabs in our
controllers. this way the rigid body will detect collisions.
For the shooting guns, I had to find a free sample of a gun
and write a script. Fortunately, I found one with script. I just added that,
and everything worked as it should. The problem was grabbing any objects with
our current hand models. Once we grabbed the gun, the gun and hand would collide,
and the hand would get in a weird position, and we knew it is because of the fingers
rigid body that prevent it from getting to the right position. Sometimes we
grabbed something, we would fly away.
I had this idea, what if grab the guns and the hand models disappear.
That way there would be no collision.
This let me learn more about the Interactor events. You must
create events when select or exit.
it means that once I grab an object SetActive will be triggered,
and the prefabs of the hand will disappear. And when I let go the Boolean changes
and the prefabs appear again.
Comments
Post a Comment