I have a Unity animator for a humanoid character(with multiple animations), who is sitting at a desk typing and moving a mouse around in one of those animations. The actual mouse and keyboard are not part of the animation itself, only the humanoid movements are.
The keyboard can be static in position, but the mouse has to move around with the animation's right hand, when the animation moves its hand.
Is there any way to achieve that through Unity ? How is this best handled ? Any video resources would be greatly appreciated.
Thanks !
Related
I have a mobile game with a simple mechanic where player must touch screen to jump. Problem is, if player clicks pause button, character jumps as well. I need to prevent this.
I came up with an idea of creating a square without sprite renderer and cover the area that I want to prevent from click and simply give a layer to that square so I can control if player is not clicking that layer, then jump.
How do I achieve this? Any help would be appreciated.
Thanks a lot.
I have created an animation where the character is holding the gun.m
This is what my hierarchy
Player
-Camera Holder
---Camera
-Collider
---Arms
-----WeaponHolder
-------LHNode
-------RHNode
-------GunHolder
---------(The Instantiated Gun)
When setting the gun I use the left and right nodes to position the arms. I animated the person living the gun up but I so far haven’t animated the gun or the gun holder. It’s not even a component appearing in the unity animation system but whenever I play the game it resets any transforms that have been applied to the gunholder. Anyone know how to help??
Hopefully that all makes sense. Thanks
I've followed the brackeys tutorials to make a 2D Player Character jump but having issues with the jump animation. When I hit jump, the Player goes into the air but it'll play the idle animation in the air til I give another keyboard input. If I hit jump again while in the air, it'll play the jump animation and go back to idle when hitting the ground.
In the animator I noticed that the jump animation triggers fast and seems to be overridden by the idle animation. I've loaded and compared the working final brackeys project, and rebuilt the animator nodes. The code and everything in the editor are the same but the only thing I can think of is that I'm using different art assets.
Here are the tutorials I followed.
2D Movement: https://www.youtube.com/watch?v=dwcT-Dch0bA
2D Animation: https://www.youtube.com/watch?v=hkaysu1Z-N8
Could you post some screenshots of your Animator Controller, its animation settings or code, please? I suspect it might have something to do with transitions or events.
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.
I have a simple project built with Cocos2D and Chipmunk. So far it's just a Ball (body, shape & sprite) bouncing on the Ground (a static line segment at the bottom of the screen).
I implemented the ccTouchesBegan/Moved/Ended methods to drag the ball around.
I've tried both:
cpBodySlew(ballBody, touchPoint, 1.0/60.0f);
and
ballBody->p = cgPointMake(touchPoint.x,touchPoint.y);
and while the Ball does follow my dragging, it's still being affected by gravity and it tries to go down (which causes velocity problems and others).
Does anyone know of the preferred way to Drag an active Body while the physics simulation is going on?
Do I need somehow to stop the simulation and turn it back on afterwards?
Thanks!
Temporarily remove the body from the space.
If you want the object to have inertia when you release it, that's a different story. The cleanest way is to attach a fairly stiff spring between the ball and a temporary sensor body that moves under the control of your finger. When you let go with your finger, the ball will retain whatever kinematics it had while you were dragging it. Be sure not to remove the ball from the space in this case.
You aren't updating the velocity of the object when you aren't using cpBodySlew(). That is why it falls straight down.
A better way to do it is to use a force clamped pivot joint like the official demos do to implement mouse control. http://code.google.com/p/chipmunk-physics/source/browse/trunk/Demo/ChipmunkDemo.c#296