unity – How can I make the objToRotate speed to rotate depending on the target moving speed?

The player has these components: Animator, Rigidbody, Capsule Collider, Third Person Character (Script), Third Person User Control (Script), and the MyLookAT script.

The problem is if I drag the cube target too fast in the editor changing its position it will take some time for the objToRotate to rotate facing the target again. I want somehow to make that the objToRotate will know to set his own speed and to rotate fast/slow enough to face the target when moving the target.

I want the objToRotate to face the target in real-time when the target is moving not with delay.

using UnityEngine;
using System;
using System.Collections;

public class RotatingTest : MonoBehaviour
    public Transform target;
    public Transform objToRotate;
    public float speed = 1.0f;

    void LateUpdate()
        Vector3 targetDirection = target.position - objToRotate.position;
        float singleStep = speed * Time.deltaTime;

        Vector3 newDirection = Vector3.RotateTowards(objToRotate.forward, targetDirection, singleStep, 0.0f);

        Debug.DrawRay(objToRotate.position, newDirection, Color.red);

        objToRotate.rotation = Quaternion.LookRotation(newDirection);

Will moving a PDF and Word Document library to a CMS negatively effect SEO on site redesign?

I’m redesigning a website built on an outdated platform, going from Asp.Net Web Forms to Gatsbyjs. The site has a PDF and Word Document library that is stored locally on the web host, so a link to a pdf would be something like:


It would be much easier, and more dynamic for my client, to store the PDF’s and documents on the Contentful cms. However, I’m concerned whether Google will look negatively on these resources no longer being located on the domain itself.

Any info on this would be appreciated.

Grouping Around a Point and Moving Together With Steering Behaviors

I have a group of enemies that move together. I have them grouped around a point by setting their target to be a point. I have combined the “Seek” (“Arrive” has the same issue in this case) and “Separate” steering behaviors to achieve this. My issue stems from the fact that they all want to move to that point, effectively fighting for the center (The separate steering behavior just has them doing this at a distance). Is there any way I could group them together like this without having them fight for the center? I don’t want to have set positions as that would be quite unnatural looking and ill-fitting for my game. I also think a flow field would have the same issues (I’m, not sure about that).

javascript – Moving part of a ASP.Net Webforms to some type of JS, maybe

got an interesting project ahead and would appreciate some tips.

I have an older ASP.Net web forms application that has been running for many years.
It’s divided into two sections, one is the admin section (where the user hardly ever spend any time) and one part is the “front”, where the user spends almost all his/her time.

I recently gave the admin section a facelift and improved the code, it works great and people are happy with it. It doesn’t matter that it’s a bit slow and there are tons of overhead since the user is hardly ever there.

Now for the fun project that lies ahead. I need to rewrite the “front”, and it cant be web forms, it needs to be some type of JS.

But, I only want to rewrite some pages with JS, not the entire front. For example, a login page, it doesn’t matter if that is written with web forms, you only use that once a day (max).

So, my question is, would it be a good approach to have a site with mainly ASP.Net webforms pages and some pages (that is used 99% of the time) in pure JS?

I do understand that it’s technically possible, I have done some tests myself and it looks like it can work, but is this a good approach?

Note, all data will be pulled from an API, so there will be no need for any backend code.

seo – What is the impact moving from www to non-www… and is it worth going back to www?

From 2013 through 2020 we had a website that was performing pretty well in terms of traffic and sales. The website was then taken down due to unforeseeable life events. After 2 or 3 months offline, we decided to restart the operation and put the website back online, however we made one crucial error. The website was previously using www and when we brought it back online we failed to take that into account and omitted the www.

Our website has been back online for 7 months now without the www. If you visit www version it redirects to non-www version.

All of our backlinks are still pointing to the www version of our website to this day.

Will this have negative ramifications on our seo? Does it make sense for us to switch the website back to www, or since we’ve already had the non-www version live for 7 months should we leave it alone? Would the pros outweigh the cons in returning to www?

display – Late 2020 Mac mini, windows keep resizing and moving upon wake from sleep or screen off

I have a Late 2020 Mac mini running whatever the latest 11.x.x is. It’s hooked via HDMI directly into a 32″ Asus monitor. Whenever I restart – which isn’t common – or wake the computer from the display being off (not the computer asleep because I have weather software connected to a weather sensor that uploads to Wunderground), windows move and resize, typically moving to the bottom-left ≈1/4 of the display, as though the OS doesn’t detect the monitor right away and tries to move things around to compensate.

This phenomenon is hit-or-miss depending on the application and depending on whether it is hidden or not. So, I just tested it again, and Safari, Finder, Keynote, and Excel all stayed put (not hidden). But, VLC moved. Then, if I do something like hide Safari and put the display to sleep, then wake it up, all my Safari windows are on top of each other in that bottom-left ~quarter of the display.

I’m a bit OCD with where I place windows and how I have them sized, so it’s a fairly continuous frustration not being able to hide things when working on certain tasks or needing to move stuff back after coming back to the computer, and then if I do forget and hide something needing to re-move and resize them all when I come back.

I thought this might be an issue with the M1 chip, or the macOS 11, but we’re now over half a year in and this is still a major issue for me, so maybe someone can help? (I’ve not owned a Mac mini before, but I’ve had several headless Mac desktops and this was never an issue)

unity – Why when adding force to transform the transform never moving pass a slope?

rb.AddForce(transform.forward * speed * Time.deltaTime);

Even if the speed value is 500 or 1000 the object is rolling but never climbs up the slope.

If I change the transform to Vector3.right instead it will roll and pass the slope with speed 500 but it will not move directly forward it will move a bit to the right. And if I set it to Vector3.forward then it will move directly to the right and even a bit back. When I’m using vector3.right this is forward and if using transform.forward this is forward but then the object will not move over the slope.

I want the object to move directly forward on the blue axis but if I’m using transform.forward it will not be able to climb the slope at all but the direction is directly forward. and if I’m using Vector3.right it will move forward but also to the right.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Rolling : MonoBehaviour
    public Transform player;
    public Transform crate;
    public Animation anim;
    public float timeToStopRolling;
    public float speed;
    public float waitBeforeSlowdown;
    public float startDrag;
    public float endDrag = 50;
    public float rotationSpeed;

    private bool crateOpenOnce = false;
    private bool alreadyRolling;
    private Rigidbody rb;
    private Quaternion defaultRotation;
    public float lerpTimeMultiplicator = 0.25f;

    private void Start()
        rb = GetComponent<Rigidbody>();

        defaultRotation = rb.rotation;

    private void Update()
        var distance = Vector3.Distance(crate.position, player.position);
        if (distance < 1.7f && crateOpenOnce == false)
            rb.isKinematic = false;

            crateOpenOnce = true;

    private void OnCollisionEnter(Collision collision)
        //NOTE: In general you should go for Tags instead of the name
        if (collision.gameObject.name == "Crate_0_0")
            if (crateOpenOnce)
                rb.drag = 0f;

                // Directly start a routine here (if none is already running)
                if (!alreadyRolling) StartCoroutine(RollingRoutine());

    private void OnCollisionExit(Collision collision)
        if (collision.gameObject.name == "Crate_0_0")
            speed = 100;

    private Vector3 GetRandomDirection()
        var rnd = Random.insideUnitSphere;
        rnd.y = 0;
        return rnd.normalized;

    private IEnumerator RollingRoutine()
        // Just in case prevent concurrent routines
        if (alreadyRolling) yield break;

        // Block new routines from starting
        alreadyRolling = true;

        // Get the random direction for this routine
        var rollDirection = GetRandomDirection();

        // Roll for the given time within the FixedUpdate call
        for (var timePassed = 0f; timePassed < timeToStopRolling; timePassed += Time.deltaTime)
            // Wait until you are in FixedUpdate
            // the code after this is now executed within FixedUpdate
            yield return new WaitForFixedUpdate();

            rb.AddForce(transform.forward /*rollDirection*/ * speed * Time.deltaTime);

        // Wait before slowing down
        yield return new WaitForSeconds(waitBeforeSlowdown);

        // Do slow down and rotate to default until both conditions are fulfilled
        var dragLerpFactor = 0f;
        // Store the original drag to reset it later
        var defaultDrag = rb.drag;
        while (!Mathf.Approximately(rb.velocity.sqrMagnitude, 0) || rb.rotation != defaultRotation)
            // Again wait until you are in FixedUpdate
            yield return new WaitForFixedUpdate();

            dragLerpFactor += Time.deltaTime * lerpTimeMultiplicator;
            rb.drag = Mathf.Lerp(startDrag, endDrag, dragLerpFactor);

            rb.MoveRotation(Quaternion.RotateTowards(rb.rotation, defaultRotation, rotationSpeed * Time.deltaTime));

        // Just to be sure to end with clean value assign once
        rb.rotation = defaultRotation;
        rb.drag = defaultDrag;
        rb.velocity = Vector3.zero;

        // Allow the next routine to start
        alreadyRolling = false;

visas – Moving to Germany with an Italian residence card (member of an EU citizen’s family)

Since you wrote that your brother travelled Germany alone and needs a work contract to obtain a visa, I would assume that he does not qualify for a residence card in Germany. In that case, the regular procedure is indeed to apply for a visa at a German consulate in Italy and to wait for that visa to move to Germany.

If your brother had moved to Germany with their EU citizen family member, he would be allowed to apply for a residence card directly (i.e. without going back to Italy to secure a visa). There are a couple of other exception to the need to secure a long-stay visa before entering the country: citizens from Australia, New Zealand, Israel, Japan, Canada, Korea and the US can apply for a residence permit directly and I believe the relevant authorities have the discretion to accept an application in exceptional cases but I wouldn’t count on it.

Either way, his status in Italy doesn’t really make a difference. It does however mean that his stay in Germany isn’t illegal as he has the right to visit Germany for 90 days. To avoid further problems down the line, I would recommend leaving Germany and going back to Italy before reaching the 90-day limit.

sql server 2019 – Moving from SQL2008 to SQL2019, horrible performance

we have a query that runs in 20 seconds on our SQL2008 server. The same query runs in 43 seconds on SQL2019 at compat mode 100. The same query runs in 4 minutes at compat mode 150.

Here is our execution plan.

Settings on new server:
Legacy Cardinality Estimator: Off
Database Compatibility Mode: 100

Appreciate any help on how we can speed this up.

Why does moving my mouse pointer towards the mac dock often move it to other monitor?

Im not talking about summoning the dock, i know how that works, what Im describing is essentially the opposite. I dont know why it happens but happens about 20% of the time I move my pointer towards to dock, the dock will just move to other monitor. Its annoying enough i cant keep the dock on one screen and still have spaces, but this just defies logic. I dont know whats causing it, if there is an obscure gesture i am accidentally doing which triggers it or if its just a glitch. but it happens on both my macbook pro with external monitor and imac with external monitor.