Does anyone know how to make your character not rotate when using WASD keys for moving? I want him to just run backwards and sideways, not turn around. I want only the mouse input to rotate my character. I have the camera parented to the character's head and I'm in Third Person Template doing an FPS.
You most likely want to enable bUseControllerRotationYaw on the Character.
Cameras and SpringArms also have a bUsePawnControlRotation.
Related
I was creating a basic scenario in Unity. Thi scene have 1 cube in the center of the room, and 1 camera(player).
I need to move the player around the cube like if was flying ( with movements at the top, bottom, left, right, inside and outside), very similar to when we move freely with the mouse on the development screen.
I need make this movement with the touch.
How can i to do?
Thanks!!
You can achieve almost all movements you want using a standard fps mobile controller: 1 joystick and a slide area for rotation. Your forward movement will be your player's forward direction(with W in unity you move always forward) and of course transform's left/right for strafe.
The tricky part is move up/down part(even in Unity editor you have to use 2 extra keys, Q&E) but you can always move up/down just looking in that direction.
if u use the unity standard asset 'cross platform input' (which is available in the standard asset pack for free,) then anything you program with a mouse event or click, will automatically call the corresponding touch event if use on a phone.
First of all, I'm a german so please forgive me my (maybe bad) English.
I'm programming a 2.5d Puzzle Jump'n'Run like Trine and of course, you can play an archer/ranger/etc. And you shoot an arrow by clicking on the screen and the archer will rotate his upper body, his arms with the bow and the head so that the bow is looking at the Point where you clicked on the screen.
Here is the problem: How can I rotate or transform the mesh of my character, that he/she is looking at the point because when I just rotate the element by script, the animator sets the Rotation to the default Rotation changes of the Animation.
Is there any way to handle this or do you know of another method?
I'm completely new to Unity and I'm starting to work on a little game for my class. The scenario says that the main character should be placed in my home town.
Since I'm not capable of modeling my town, I tried making skybox from google street view images using free plugin I found. It looks ok, so I tried adding an avatar, and that's where I'm having troubles.
When adding an avatar, he falls trough the floor, I suppose because its only image underneath him. Then I tried adding box below his feet, and now he levitates in squat position abowe it.
Has anyone any suggestions or ideas on how to fix this? Or maybe some suggestions on different vay of doing this would also be apprechiated.
Here is a photo of what it looks like now:
https://postimg.org/image/ehklr8sg5/
The reason your character falls is because there is no "floor" yet. The skybox is nothing but a special cube that wraps infinitely around your scene. With the street view images it may appear like the character is standing on solid ground based on the optical illusion of the skybox, but they're actually floating in space. When you press play, the physics engine starts, gravity takes hold, and your character falls.
There are a number of ways to prevent them from falling.
Disable Gravity on Character
This is only a good idea if you're not planning to use physics in your game.
Select your character's root node in the Hierarchy
In the inspector, find the RigidBody component
Uncheck Use Gravity
Add Floors
Add something with a collider on it that doesn't have a RigidBody. The collider will prevent the character from passing through it and the lack of RigidBody will ensure it doesn't also get affected by physics or gravity.
Create > Plane
Set its transform position to 0, 0, 0 so it's centered in the world
Scale it up big enough for your character to land on
Uncheck the Mesh Renderer in the inspector to make the plane invisible
I am making a VR Game in Unity. But the problem is, after generating the apk and installing it in my phone, when I look through the cardboard my first person character is fixed at a single position only.
When I look at different directions, the fps arm remains at the same position, it doesn't rotate according to the direction I am facing.
I am using Unity Cardboard asset and I am working on Unity 5.
I've had a similar problem before, make sure that your model is a child of the Head Component, that way your model will be fixed to the head as it rotates.
EDIT
From the image you supplied in your question, you have the Unity Standard Asset FPS controller. This moves by mouse movement, which of course you cannot do on a phone. Because your arms are a child of the FPS Controller, they will only move if the mouse moves. Therefore you need to make your Arms a child of the Head component, like so:
I'm making a fps game and I want my character's arms to rotate up and down depending where the cursor/camera is pointing at. The character already rotates when I turn left or right. Hopefully someone can answer my question. I'm new to Unity and I'm still learning how to code in C#.
For top and bottom rotation, create an animation for top aim, eye level aim and feet aim. send the value of your rotation to animator controller and animate according to it.