unity – Unwanted jump when landing

What you have here is called input queuing. When the player presses the jump button, if you can’t act on it right away, you store-up that button press to fire again when it’s applicable.

This can be a good thing in many games. Celeste, as one example, queues a jump input up to a few frames before you land, so if you press the jump button just a moment too early it “snaps” to a perfect moment-of-landing rebound, improving game feel and making it easier to pull off some of the fast-paced precision platforming challenges in that game.

It’s also important when you’re gathering your input in Unity’s Update() method, but acting on it in FixedUpdate(). If the player is running at a very high framerate, you might not get a physics step the first frame after a button press, so if we clear jumpKeyIsPressed back to false in the next Update() then we might erase it before we had a chance to apply it.

The trick is that you don’t want to queue the input infinitely! Right now you keep jumpKeyIsPressed == true eternally until we touch the ground and are allowed to jump again and finally consume that input.

A quick and simple fix if you don’t want to keep the input queuing at all is to act on the jump input as soon as it’s received:

void Update()
{
    if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
    {
        rb.AddForce(Vector3.up * playerJumpVelocity, ForceMode.VelocityChange);
    }

    horizontalMovement = Input.GetAxis("Horizontal");
}

(I changed your variable name from playerJumpForce to playerJumpVelocity because the way you’re using it, it’s not actually a force measured in Newtons. It’s a delta-v measured in m/s)

You want to apply any continuous movement changes in FixedUpdate() to make sure they’re always consistent, no matter how the rhythm of display frames and physics steps interleave. But for an instantaneous change like a jump, there’s no harm in applying it eagerly in Update() – it won’t kick in until the next physics step anyway, the same as if we queued it up.

If you’d like to keep the input queuing behaviour, we’ll just want to give it a time window it’s valid for. Instead of tracking a Boolean for whether it’s pressed or not, we’ll keep a float tracking how long ago it was pressed.

float jumpQueueWindow = 2.0f/30.0f; // Queue for up to 2 frames at 30 FPS.
float secondsSinceJumpPressed = float.PositiveInfinity;

void Update()
{
    secondsSinceJumpPressed += Time.deltaTime;

    if (Input.GetKeyDown(KeyCode.Space))
    {
        secondsSinceJumpPressed = 0f;
    }

    horizontalMovement = Input.GetAxis("Horizontal");
}

void FixedUpdate() {
    rb.velocity = new Vector3(horizontalMovement * movementSpeed, rb.velocity.y, 0);

    if (isGrounded && secondsSinceJumpPressed <= jumpQueueWindow )
    {
        rb.AddForce(Vector3.up * playerJumpVelocity, ForceMode.VelocityChange);
        isGrounded = false;
        secondsSinceJumpPressed = float.PositiveInfinity;
    }
}

You could also store a timestamp when jump is pressed and compare it against the current time. That saves accumulating deltaTime into your variable each frame, but it means the precision of your jump window is limited to the precision of your timestamp, and the precision of Time.time in Unity loses precision if your game’s been running for many hours continuously. So I like to err on the side of using frame deltas which keep their precision no matter how long your game’s been running.

web – “Website in development” landing page – is it worth doing (e. g. in terms of SEO)?

We are developing a website and plan to launch the next spring.

I already bought a domain and currently it displays no content. I was wondering whether it would be worth it to create a very simple landing page, basically saying only that the site is currently in development, and for example setting up a SEO so that search engines can start to index it.

Note that I am living in a small country (~5-6 million people) and the website is dedicated to our small market, therefore I believe the website could appear among the first search results pretty quickly. Actually, what inspired me to pose this question was the fact that I was recently googling something in my language and about the 5th result was a page with nothing but a logo and a text “Site in development”.

Is something like this worth doing?

I will create a modern WordPress landing page, WordPress squeeze page, elementor landing page for $10

I will create a modern WordPress landing page, WordPress squeeze page, elementor landing page

Hello there,

Are you looking for someone to make a Responsive WordPress website or Landing page?

if yes, I am the one you’re looking for. I will design your website or landing page by using the elementor pro page builder, which is fully responsive to any device.

I have been working on WordPress jobs for a very long time and I can honestly say that I have gathered much experience in this field.

Services of this gig:

  • WordPress responsive Landing page
  • Responsive Animation
  • Contact form
  • Social media integration
  • Popup functionality
  • Live chat feature
  • Mailchimp
  • Fast load website
  • Google map

Why you should select me for this job:

  • Highly professional and top-notch service
  • SEO ready, optimized, lightweight, super-fast workmanship.
  • You will get 100% up to your satisfaction
  • Fluent and friendly communication
  • $$ back Guarantee

You are ready now? Let’s go to the next stage Be sure to contact me first before placing an order to get a special offer.

Thank you!

.

url – How do I configure landing page of my website which is index.html to website root directory

Hello guys I am Akshita Patel who is an owner and author of the website which is https://www.akshitapatel.biz/

I have defined the canonical URL for the landing page, as mentioned above.

I have created sitemap.xml file by using online sitemap generator and I have found that there are are two different urls for a single landing page. User defined canonical URL is https://www.akshitapatel.biz/

And other one is https://www.akshitapatel.viz/index.html

I have tried using redirection code in .htaccess file, which is placed on the root directory. It seems that the website hosting platform is being used for the website is not supporting htaccess file.

Because of the following issue the keyword rankings of my website is qip getting down hair on this stack exchange I am looking for help by the expert designers and web developers.

Kindly help me to get rid of this problem. I simply want that the present canonical URL I have mention in head of the landing page should be considered as a a landing page rather than considering two different urls for the same landing page.

sitemap urls

Kindly see the screenshot of sitemap.xml page, where you can see two different URLs.

The current website hosting platform of the the given website it is not supporting htaccess file so so I am looking for or something another solution tu to resolve this problem as soon as possible

I had created two different websites from the same website designer software cold coffee cup but 8000 website which is https://www.enjoyincity.in/

This both websites are designed by using the same website Designer software known as coffee cup I have used the same type of canonical URL before the header is closed in the HTML page but Akshita Patel is not being redirected from index got stml to the root directory and the other website which is enjoy in city is not showing the same error. Even though XML sitemap of both of the websites are created by bhai the same tool I don’t know why this problem is concerning with Akshita Patel only.

Because the website hosting of both websites are different the 1:00 Akshita Patel dot bass is using as drive which is the the website hosting platform offered by the coffee cup side Designer software and other website it is hosted on namecheap. In the namecheap control panel there is a predefined option is available for URL redirect.

Looking for help.

Thanks
With regards
Akshita Patel

html – Product landing page using flexbox

This is my first time making any web page from scratch on my own. I have used a flexbox for making it responsive. I have done it but not sure if I have done it the correct way.

I read somewhere that we should minimize the use of @media if we are using flexbox. How can I do it?

In my code I have used

#nav-bar{
    top:0;
    position: fixed;
}

This cause the element below it to hid under navigation bar but if I use sticky instead of fixed there is no such issue. If I have have to anyway use fixed, how can I prevent text from hiding below?
Feedback and suggestions will help.

Code Link: https://codepen.io/tushar_432/full/yLORWaR

magento2 – How to get the specific product information on product landing page

I need the specific product id and product price on the product landing page to push in the datalayer magento 2.
Here is my code for datalayer

window.dataLayer = window.dataLayer || (); 

window.dataLayer.push({

  ‘event’:’product_view’

  ‘value’: ,

  ‘item’: (
    {

   ‘itemId’: ,

   ‘google_business_vertical’:’retail’,

   })

});

How can i get the product price and product id on the product landing page
I am using this code in details.phtml file in magento module how should i get the specific product information here

If my final destination is Bursa City, Turkey, is landing in istanbul airport my best option?

My final destination is bursa city in Turkey. I can have direct flight to Istanbul, from my city alexandria, Egypt but is it best to land in istanbul or should I land in another airport?

I will travel with my 2 kids and wife and I mean by best affordable and comfortable for my wife and kids.

I’m really worried how would I move with at least 3 big luggage and 2 small bags with my two kids. They are almost two years so too heavy to carry and if I used a baby car it would be difficult to move two baby cars and the luggage even with my wife’s help.
So transmitting to ferry from taxi and then another taxi doesn’t seem plausible to me

I do believe that travelling with my family to cairo will be more comfortable and cheaper than travelling long distance in Turkey. But I am not sure if I took off from cairo airport that would allow me to land near Bursa.

There are a lot of international airports in Turkey and i am confused and most online booking websites doesn’t allow you to specify generic destination and give you best route.

Thank you for advance.

html – Como coloco responsividade no resto do codigo dessa landing page? o menu esta ok. porem tenho duvidas do restante

Obrigado por contribuir com o Stack Overflow em Português!

  • Certifique-se de responder à pergunta. Entre em detalhes sobre a sua solução e compartilhe o que você descobriu.

Mas evite

  • Pedir esclarecimentos ou detalhes sobre outras respostas.
  • Fazer afirmações baseadas apenas na sua opinião; aponte referências ou experiências anteriores.

Para aprender mais, veja nossas dicas sobre como escrever boas respostas.