We are working on a VR Driving project using Oculus controllers. We are stuck on a bit wherein we are tryin to move the car forward and backward using the controllers. The camera view is set to be inside the car, but when we try to move the car faster, the camera view moves out of the car.
In addition to this, when we turn left or right and try to move forward, the car seems to move sideways but not in the direction to which we turn towards. Kindly help us on wit this issue.
The Unity version that in use is 2021.3.11
we wanted the player to drive the car smoothly but as soon as the speed is increased the camera tends to jump out of the car.
Related
So I am making something in unity for VR and am trying to remove slope bounce when going down slopes. Every tutorial I see is manipulating the player movement functions in the player script, but I am using the Action Based Continuous Move Provider for my movement so I don't have access to that stuff do I?
Basically, I am wondering how to smooth slope movement when using this locomotion system.
I have tried looking at a bunch of Youtube tutorials but they all end up modifying the players' movement directly so that it is parallel with the plane you're walking up. I understand it but I'm not sure how to do it with the continuous move provider.
hi i was making a multiplayer game where at some point the bullet was colliding with the sender and i don't want that. It keeps making glitches and the bullet keeps floating. I even tried reducing the player box collider but its still getting stuck. if i disable collision detection for the player and the bullet, the multiplayer version will be affected and players won't be dying
Please help
tried to reduce the player collider but when the bullet is shot on y axis its getting stuck
Since you're doing a multiplayer game, On the client side you could change the player's object layer to something unique. In my case here, I've added a new layer called Player and I'm instantiating my player on a layer called Enemy by default. I'm also putting my bullets on a layer called Bullet.
Make sure you only change the layer from Enemy to Player on the client side at runtime and for your client's player object only.
Then you can go into Edit/Project Settings/Physics and scroll down to the bottom until you find a collision truth table.
Then ensure that you uncheck the collisions between your player's layer and bullet's layer.
As stated in the title. I will include a video of what I'm trying to make. I'm not sure how to make the part that the player swings on.
https://youtu.be/Z_RVr0nFpVE
Description of the mechanic: when the player taps a "web" is created that goes from the player to the roof at a slight angle forward. This web gets shorter over time. When the player stops tapping the web goes away.
I’m sure that there is no physical rope or string simulation. The easiest way is to slow the horizontal speed down, add decelerating up-directed velocity, and draw a rope from the origin to the player. After parameters adjustment the result should look similar to what you’ve shown.
I'm having some interesting behaviour with NavMeshAgents. So I've been working on a project for the past few months which is revolving around creating believable enemy AI systems for stealth games. When the player kills an enemy they can pickup the body and put it into a body bag, this all worked well and fine for a while but now once the player has picked up two corpses all Nav Agents do this.
They are still in their patrol state (using a behaviour tree) and all of the AI have a destination set which can be seen on the debug tools for the Agent. However if I try to move the AI whether that being dragging them around or setting a position through the inspector they will snap back to a corner of the NavMeshSurface.
Using Unity 2021.1.17f1 and using the latest compatible version of the NavMeshComponents package provided by Unity.
Things I've tried:
Changing Radius and Height of agents
Setting the floor and such as navigation static objects
Removing the NavMeshComponents package scripts and replacing them with the original NavMesh system. Didn't work and took a lot longer to build the NavMesh
Interesting behaviour:
The amount of body bags the player has to pick up seems to be related to how many AI are in the scene. For example currently there are 23 AI and it takes two body bags for this glitch to happen, but if there are 24 to 31 AI in the scene then it requires three body bags to be picked up for it to happen.
All calls to the NavMeshAgent are done through a AILocomotion script which handles enabling and disabling rotation, movement and updating the animation. Movement is only disabled upon death or when the AI is in the wait state, other than that every Move based state re-eneables movement.
Update: Found the solution
It turns out Unity does not like it when you destroy a NavMeshAgent component during runtime. Now when the player picks up a corpse it leaves the NavAgent behind but destroys the mesh and colliders etc.
I am currently working in a Unity 3D project (in version 5.0.1 to be precise) in which the character can walk in different-shaped planets without falling. So it is always attracted by the planets gravity (similar mechanic to the Super Mario Galaxy games).
Now, the problem is when I try to code the AI for the enemies. This AI should be pretty much simple, but because of this thing that I have with the planets shapes, I haven't been able to come up with a solution. The enemy should check where the player is and move ahead to its position. It's a really dumb enemy. But the thing is, that the enemy must be able to track the player and get to its position no matter what planet he is in. So, if the planet is circular, I cannot make the enemy look at the player and then move forward, as I would do in a plane planet.
I have already tried using a NavMesh, but Unity doesn't want to collaborate and ends up making a NavMesh of 1/3 of the planet. I don't understand why. I have tried changing every single parameter of the NavMesh baking but I haven't succeeded.
Another problem that I would like to do is: ¿How would you make a player be able to walk on the surface of any planet, no matter what its shape, in a smooth way while using a Mesh Collider? I am currently achieving this by getting the planet's normal with a raycast, rotating the player so that the Y axis is perpendicular to the normal and applying a force in -Y to simulate gravity. But this brings lots of problems when I implement the Mesh Collider. It results in a jittery effect. But, when I use a primitive collider from Unity, it works fine...
Anyway. What I need the most now is the answer to the AI question. The other one is kinda like a plus.
P.S: It doesn't matter if the solution is in Javascript. I can then translate it to C# :)