I am kind of new to Unity in general, i am building a 2 player online board game using PUN 2. where players camera opposite to each other. i rotate the Game Board 180 degree for 2nd player. I have encountered a problem with the changing position. my approach to this problem is not correct to rotate 180 degree.
Related
I make a game with unity in 2d mode.
I want FPS mode and a camera such as DOOM game that hand are in from of player view but in 2d game mode.
Make camere child of Player object so it moves and rotates along with player.
But you stil probably want it to be perspective camera and " 3D" game even if you use flat objects with no depth.
Doom was 2D but it was pretending to be 3D
It all depends what you mean by 2D, there are many ways depending on what you want.
I'm currently building a 2D topdown zombie survival game in unity where the player must run around an environment trying to get collectibles, I'm looking to have the zombies spawn from different points around the map when the player gets close to a spawn point, but id like for the enemies to only follow/chase the player when they can see them (Compared to what I have now in which they just move to the player straight away). Does anyone have any good links or ways of implementing this? all the tutorials I have looked at are for a playable character and not an enemy NPC.
Thanks
You need to:
Raycast from the NPC to the player to check for a clear line of sight
Create a field of vision to determine the angle of their peripheral vision
Ensure any successful raycast is within the angle of vision
If all of this is true then trigger the navmesh agent to walk towards the player.
Optionally, you can record the last player position where the NPC spotted the player; then if they break LOS (line of sight) the zombie moves to that position and looks around to re-establish LOS.
I've developed an airplane 3D shooter game. In this game, I want to make my plane shot a bomb. When the bomb gets to the enemies it will explode and give damage in the area of explosion.
I have already searched for a tutorial to make this code and the animation of explosion. But I couldn't find it. Please tell me about something that could solve this problem. I'm developing my game using C#.
For the explosion animation, you could use a particle system. There are many pre-made ones in the Asset Store, such as this one: https://www.assetstore.unity3d.com/en/#!/content/42285
For detecting what is affected in the explosion's area of effect, do a SphereCast (https://docs.unity3d.com/ScriptReference/Physics.SphereCast.html) from the point of impact and then do whatever you want with any of the objects touched by the sphere.
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 am trying to make an mobile application that contains AR(Augumented Reality)-Mode using Unity3D. So I have connected my mobile device with my unity3d program, and the camera works fine. But when move the mobile device, the main camera inside unity program does not move the same orbit that the mobile device moves. Does any one know how to change or control the orbit of the main Camera in unity3d?
This could be happening due to a number of reasons. It could be due to non centered pivots, or coordinate systems for example.
Could you please specify which AR system are you using? As a side note, at work we recently had a project involving Unity3d and Metaio and it was a nightmare to bend the system to do what we needed, specially when we needed to do a lot of object positioning based on the local coordinate system.
When you refer to the orbit of the camera, I imagine it could be that the pivot of the camera is somehow offset and the camera is rotating around that offset. Or maybe that the camera is a child of the actual Game Object that is controlled by the AR system, in which case this parent node acts as a pivot to the camera.
In the picture below you can see that the camera is away from that center point and when it rotates it does it based on that center point, in other words the camera always tries to look at that center point and it gives that feeling of "orbiting" when it moves.
Here's the link to the image (I can't post pictures yet on this forum -.- )
http://i.stack.imgur.com/fIcY2.png