I'm a novice game designer and a coder new to the term 'coyote time.'
I've always felt its existence before or after practicing game design as a career ever so naturally playing other games, but now that I have to implement it to my own game I'm kind of confused how to actually attempt to do it.
My game is set up with modified CharacterController in 3D world space as an orthographic 2D platformer. If anyone could give me where to look for head start trying to implement this feature for the first time or a very simple example I'd appreciate it very very much. Google didn't quite cut it this time for me :(.
It's 11 months late but hey, maybe someone else will benefit from the answer.
Have a player variable called coyoteTime. Whenever the player touches the ground, set coyoteTime to a certain number between 0 and half a second. At every game update, reduce that number. If the player touches the ground, set it back to that number.
When the player tries to jump, if (0 < coyoteTime), the player can jump.
This is basically just extra time to jump
Related
I would like some help to make a code that the gun stays still looking at the planes and shooting
with a time delay and without focusing exclusively on one target, kill one, switch to another.
I was able to make the bullet travel in the direction, but I couldn't get the gun to aim and create the bullet in the scene.
I'm new and I know almost zero programming, I've been looking for this without sleep for over 20 hours.
(sorry for the writing, I used google translate)
Create a weapon that focuses on a target and shoots killing one or more targets (weapon not so accurate)
I would like to try and make a game similar to Altos Adventure. I am having trouble starting.
How to set up the terrain so that my character doesnt get stuck?
I simply drew a test sprite for the ground in photoshop. What collider2d should I use?
I use polygon collider and reduce friction in the material. But the character gets stuck, hits small invisible bumbs and it feels awful. The worst part is connecting 2 ground sprites together! The point where they connect is always messy.
I have a question for the future as well. How would I add the endless part of the game?
Would having many "pieces" set up and just spawning them as the player rides down work?
I havent written any code yet as the problem is simply in the physics in my opinion.
Thanks to anyone who takes the time and tries to help!
To move your player use rigid body.AddForce(Vector3 direction, ForceMode forceMode); then create a Physics Material with friction = 0 and put it in your player's collider.
I ACCIDENTALLY programmed this function (it was just 2 lines or so) a few days ago to orbit the camera around the player with the mouse x input value, but now I just can't get it to work again. I saw many solutions, some even used LookAt, but my own function was really very simply.
My player is constructed like this:
PlayerObject
CharacterWithBones (child of PlayerObject)
OverShoulderCamera (child of PlayerObject)
Could somebody tell me again how to orbit the mouse around the player so that the camera always faces the player?
I do swear that it was without LookAt, and it was really simple. But now all solutions that I can think of would be overkills.
Thank you for the help.
I have a question that is a little... complex
basically I want a gameObject (an enemy) "listen" to the sound of the player (footsteps, door opening, gunfire etc)
I could do this just fine by using:
>Collider[] hitColliders;
>hitColliders = Physics.OverlapSphere(transform.position, 10f,enemyLayer);
>
>for(int i=0;i<hitcolliders.Length;i++){}// Call Enemy Hear Player Function
However, the problem starts here:
I want the "sound" to be blocked by walls. At first, I thought I could use Physics.Linecast to do this. However, this means the sound could be blocked by a mere piece of pole, because Physics.Linecast only shoots a single, straight line.
What I want is player C could not hear anyone at all, but player A and B could still hear each other.
I hope you guys understand my question.
You could place the objects you want to block the soundwave on a specific layer. And just make the raycast ignore all other layers.
Leave all this Physic and other graphical stuff behind.
Create a separate logic for this behavior.
Create a big chess board (where x,y will be x,y position in you game) and add only sound-generators, sound-listeners and sound-obstacles.
Update this chess board each frame and create sounds, fly sounds, block sounds and listen to sounds and act appropriate as the real life actors.
This way you can add parameters to each obstacle, sound-generator and sound-listener so that all be configurable.
I am making a game using a combination of Blender and Unity and have hit a wall. I am trying to make it so a lamp flies off of a table and smashes against a wall once the player walks past a certain point in the map.
I am having a hard time with this. Any help is appreciated.
You need to break this up into little parts.
The first part is that once the player walks past a certain point you want to do something. To do this, look at http://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html
An on trigger event will let you run some code when an object collides with another object. In your case, when your player collides with a certain point in the game.
Next, inside that OnTriggerEvent, you want to fire the lamp off the table. To best do this, create a keyframe animation (or whatever you're most comfortable with) that animates the lamp to fly off the table. Lastly, play that animation in the trigger event. http://unity3d.com/learn/tutorials/modules/beginner/animation
To summarize, when the user hits a certain point, play an animation on the lamp.