unity – For my Heat I want to change the players speed but its not working

You need to make sure you either drag the PlayerMovementScript into the slot on the PlayerHeat script or use GetComponent<ScriptName>() if it is on the same object!

What is worth bearing in mind is, all “MonoBehaviour” Scripts are Components that live on Game Objects so if you had a MonoBehaviour Script called “PlayerHealth” you could use this.GetComponent<PlayerHealth>(); to retrieve it.
Then do something like playerHealth.TakeDamage(damageAmount); to call public functions on it or, as you see below public fields(variables)

You would do something like

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerHeat : MonoBehaviour
    public float maxHeat = 100;
    public float currentHeat;
    public float heatLossPerSecond;
    public float moveSpeed = 4f;
    //either drag your player movement script into this slot in the inspector 
    public PlayerMovement playerMovementScript;

    public HeatBar heatBar;

    void Start()
        currentHeat = maxHeat;
        //or if the script is on the same object you can just do 
        playerMovementScript = GetComponent<PlayerMovement>();

    void Update()
        if (currentHeat <= 40)
            //here we set the moveSpeed variable of playerMovementScript to the new 
            playerMovementScript.moveSpeed =  2;
           //You can reset the value here if you go above 40 heat, or not, upto you!
            playerMovementScript.moveSpeed =  2;

        currentHeat -= heatLossPerSecond * Time.deltaTime;
        if (currentHeat <= 0)
            currentHeat = 0;

    public void Heat(float amount)
        currentHeat += amount;
        if (currentHeat > maxHeat)
            currentHeat = maxHeat;

WordPress speed optimisation based on GTMetrix ranking for $10

WordPress speed optimisation based on GTMetrix ranking

Is your WordPress site running slow? Did you know that speed of your website directly affects search engine rankings? Faster websites have better search engine positions.

What’s included in the gig:

  • Reducing TTFB (time to first byte) by enabling page caching
  • Minifying and combining CSS and JavaScript
  • Setting expiry headers
  • Enabling Gzip compression
  • Leverage browser caching
  • Optimizing all images without quality loss
  • Enabling CloudFlare or similar CDN (Content Delivery Network) for your website to enhance response time for static content

Some of the above options require installation of a plugin. On VPS and dedicated servers some additional packages might need to be installed in order to get best performance.

Full report of installed plugins and additional packages on the server will be provided.

Design and functionality of your website will not be affected.


The obsession with Page Speed

Great thread discussing the in and outs of building a faster page. It includes lots of tool talk, and touches Core Web Vitals.

dnd 5e – If a flying creature with no swim speed ends up in water, can it fly out?

Assuming there is no magic holding it aloft and it doesn’t have the ability to hover, when a flying creature is knocked prone, it falls.

What happens if the creature was flying over a body of water? Can it effectively use its movement to “stand up” on its next turn and resume flying, or does it end up like that video of the bald eagle swimming, where its feathers are too wet and it can’t reasonably get enough lift to take off again?

Ducks can take off from water, but I would argue that ducks have a swim speed.

What is the actual speed in MPH or KPH for movement in CoD?

I looked in the core book but I couldn’t find it. The index points to page 92 but I don’t see what the actual MPH is. I get that CoD is not necessarily a stats-heavy game but I’d like something to go off of if some moves at 4, someone else moves at 4×4 or 10×4.

differential equations – I need to obtain distance and speed vs time in one direction gravitational force

I got frustrated from trying to solve supposing simple physic’s problem. All book, textbooks, lectures are always calculation escape velocity from conservation of energy law. I am more ambitious more than that, I want to calculate r(t) and v(t) in one dimension if a stone is thrown up with high speed and observe myself, as a function of time, what is r(t) and r'(t) as a function in starting velocity on a massive planet.
The equation is simple but all trials failed
mr”=Gm*M/r^2 =→
I wrote a code but it gave me the distance embedded in an equation which it cannot solve (Mathematica12.1)

The trial:

Delete All Output;
DSolve(r''(t)*(r(t))^2 + (G*M) == 0, r(t), t)

And this was the solution!

Solve((-((2 G M ArcTanh(Sqrt(C(1) + (2 G M)/r(t))/Sqrt(C(1))))/C(1)^(
     3/2)) + (Sqrt(C(1) + (2 G M)/r(t)) r(t))/C(1))^2 == (t + C(2))^2,

And Mathematica 12.1 can’t solve its solution

Also used NDSolve:

Delete All Output;
Clear(k, R, v);
R = 6371 E 3;
k = 5.972 E 27;
v = 500;
NDSolve({k + y(x)^2 (y^(Prime)(Prime))(x) == 0, y(0) == R, 
  y'(0) == v}, y, {x, 0, 100})

Plot(Evaluate(y(x) /. s), {x, 0, 100}, PlotRange -> All)

I got This comment:
{s} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.

Any help to get r(t), and v(t) for one dimensional motion described by universal gravity law?

performance – Site speed using web fonts – Self-hosted vs Google Fonts etc

Whilst looking for the right solution for me, I have been looking at the question here Using fonts on websites: Webfonts vs downloaded fonts, and one of the answerers states:

The information given to you was seriously outdated—and unrealistic, since most people could not be bothered to download and install fonts.

I can be bothered to install fonts on my hosting server if it is beneficial to, and this is the crux of my question here.

The question I linked to here talks about the benefits of using Google Fonts when developing their site. Using CSS to import a Google Font for use by using for example:

@import url(//fonts.googleapis.com/css?family=Open+Sans);

then using the font in the body

body {
  font-family: 'Open Sans', sans-serif;

would definitely be beneficial when developing your site off the hosting server through systems such as Wamp as an example, but what about when using Google Fonts on a live site?

Do you get a site loading speed benefit using @import url(//fonts.googleapis.com/css?family=Open+Sans); or is it more speedy for site loading to download the fonts for use self-hosted?

Why does the time taken keep going down when using performance.now() to test function speed? (JavaScript)

I am trying to use performance.now() test the time it takes for a function to run. It does this for a set number of times and logs the time taken each time. However, every time it loops through, it continues to decrease. Why does this happen and how can I fix it?


function TimeTaken(times_to_run){
            const {performance}=require('perf_hooks')
            var t=times_to_run
            var TimeTakenArray=()
            var Start=0
            var End=0
            var TimeTaken=0
                console.log("Time Taken: "+TimeTaken)


Time Taken: 0.061300039291381836
Time Taken: 0.006899833679199219
Time Taken: 0.003000020980834961
Time Taken: 0.0022001266479492188
Time Taken: 0.002199888229370117

performance tuning – How to speed up integers finding function?

Playing with integers I looked for a way of finding, let’s say, $4$-digits positive integers such that $a,b,a+b$ had the same digits, like $$1089 + 8019 = 9108$$
I am a newbie and I used this function

sd[a_, b_] := 
 If[Mod[a, 9] != 0 || Mod[b, 9] != 0 , False, 
  Sort[IntegerDigits[a + b]] == Sort[IntegerDigits[a]] && 
   Sort[IntegerDigits[a]] == Sort[IntegerDigits[b]]]

Then I used the function in this way

  Table[{h, k, sd[h, k]}, {h, 1000, 10000}, {k, h, 10000}], 1], #[[3]] &]

But it took ages to give the output.

Is there a way to speed up this procedure?

Thanks in advance

How to Speed up Website?

Great answers here.

Your website speed depends on:

– Your CMS
– Your themes and plugins
– Your web host
– Your website assets (images, videos)

You can get a better idea on what’s slowing down your website by running a test on https://gtmetrix.com/

What you are looking for is the waterfall section, see which files are taking the most time: https://i.imgur.com/KAbEOye.png

Notice in the image (https://i.imgur.com/KAbEOye.png) how some files are taking over 10 seconds to load!

Those files will need to be looked into, the solution is usually:

– Compress files
– Host files on a Content Delivery Network

Hopefully that answers your question, let us know how it goes!