When using ik to llok at target for some reason if the target is moving and coming from behind the player head will not rotate completely to the side

using System.Collections; using UnityEngine;  [RequireComponent(typeof(Animator))] public class LookAtTarget : MonoBehaviour {     public Transform lookObj = null;     public float finalLookWeight;     public float weightDamping = 1.5f;      protected Animator animator;      void Start()     {         animator = GetComponent<Animator>();     }      //a callback for calculating IK     void OnAnimatorIK()     {         if (lookObj != null)         {             Vector3 flattenedLookAtVector = Vector3.ProjectOnPlane(lookObj.position - transform.position, transform.up);             float dotProduct = Vector3.Dot(transform.forward, flattenedLookAtVector);             float lookWeight = Mathf.Clamp(dotProduct, 0f, 1f);             finalLookWeight = Mathf.Lerp(finalLookWeight, lookWeight, Time.deltaTime * weightDamping);             float bodyWeight = finalLookWeight * .5f;              animator.SetLookAtWeight(finalLookWeight, bodyWeight);             animator.SetLookAtPosition(lookObj.position);         }     } } 

When an object that is rotating around my player the head will rotate looking at the target to the side if the target that is rotating around coming from the front of the player but if the target is coming from behind the player will not rotate the head completely like when the target is coming from the front.

I tried to switch the line :

float lookWeight = Mathf.Clamp(dotProduct, 0f, 1f); 

With

float lookWeight = Mathf.Abs(dotProduct); 

When using Abs instead Clamp it fix the problem but than the looking at smoothing is less smooth when using Clamp. It is smooth but not as with Clamp.

This screenshot is when the basketball the object the player is looking at coming from the front to the back the player is looking at it even when it’s on the side which is good and what I wan it to behave like.

Basketball is rotating around the player in this frame is when the basketball came from the front

In this screenshot the basketball is keep rotating around the player and coming moving forward from behind from the other side and for some reason when it come from behind the player start looking at not when the basketball is on the side but a bit more when the basketball is a bit more in front of the player :

Basketball is coming from behind but the player detect the basketball only when the basketball get much more to the front of the player.

Lock focus on cell / Identify reason for loss of focus

The code at the end of this post is a snake game. It’s a Dynamic Graphics wrapped in an EventHandler that responds to arrowkeys. A ScheduledTask does the logic five times a second. I hit shift-enter to create it, and click the Graphics with my mouse (border turns orange) to start controlling it.

However, once the score hits 10, the Notebook is no longer focused on the cell (border no longer orange) and key input stops. Loss of focus also happens if I uncomment the bezier curve drawing — perhaps excess computation in the task is causing it. Something that continually directs focus to the particular cell, i.e. having FrontEnd&#96;MoveCursorToInputField in updatetask is not desired; I want to prevent unintentional loss of focus. Functions to help track focus in the Notebook would be useful too.

ClearAll[food, snake, dir, lastdir, updatetask, empty, \ reserverandomlocation, reserve, score] empty = Flatten[Table[{i, j}, {i, 0, 9}, {j, 0, 9}], 1]; reserve[point_] := (empty = DeleteCases[empty, point]; point);  reserverandomlocation[] := reserve@RandomSample[empty, 1][[1]]; food =   reserverandomlocation[]; snake = {reserverandomlocation[]}; dir = \ {Cos@#, Sin@#} &@((RandomInteger[3] \[Pi])/2); lastdir = {0,    0}; score = 1; updatetask =   SessionSubmit[   ScheduledTask[lastdir = dir;     With[{new = (Mod[#, 10] &) /@ (snake[[1]] + dir)},      If[food == new, ++score; food = reserverandomlocation[],       AppendTo[empty, Last@snake]; snake = Most@snake];      If[MemberQ[snake, new], dir = {0, 0}; TaskRemove@updatetask,       PrependTo[snake, reserve@new]]], Quantity[.2, "Seconds"]]]; EventHandler[  Dynamic@Graphics[{{Blue, snake, Red, food, Black,        empty} /. {a_ /; NumericQ@a, b_ /; NumericQ@b} :>        Rectangle[{a, b}, {a + 1, b + 1}], Black,      If[dir == {0, 0}, Text["dead", snake[[1]] + {1/2, 1/2}],       Arrow[{# - dir/3, # + dir/3} &[snake[[1]] + {1/2, 1/2}]]],      Text[ToString[score], food + {1/2, 1/2}](*,BezierCurve[#+{1/2,1/     2}&/@#]&/@Split[snake,Norm[#-#2]\[LessEqual]Sqrt[2]&]*)}],   MapThread[#2 <> "ArrowKeyDown" :>      If[Norm[# - lastdir] < 2, dir = #] &, {CirclePoints[{1, 0},      4], {"Right", "Up", "Left", "Down"}}]] 

P.S. how do you input grave in code? Certainly not like this &#96;.

What can be a reason of a “The requested URL / was not found on this server” error in case of an addon domain?

Let’s say I have a site hosted on a.example.com. I’m adding an addon domain to the server (shared hosting): b.example.com and point this domain to the server IP address.

Visiting b.example.com provides the same site as a.example.com, since they point to the same server. That’s OK.

Then I’m adding an other addon domain c.example.com and point it to the server IP. When visiting c.example.com I get the error: The requested URL / was not found on this server.

Can you tell me a reason how this could happen? I don’t get it.

Is there a reason not to take the optional class features from Tasha’s Cauldron of Everything?

Tasha’s Cauldron of Everything includes optional class features for every class from the Player’s Handbook. Barbarians, for example, can choose to gain an extra skill proficiency at 3rd level, and/or choose to gain a small bonus move as part of the action they take to start raging at 7th.

These features are listed as optional, but they don’t seem to have any drawbacks attached, besides a note that you should consult with your DM about taking them. Given DM approval, is there any good mechanical reason not to take an optional class feature, or should they essentially be considered upgrades over the base class?

I gave a too powerful magic item at too low level for a bad reason, what to do?

When a paladin in the game I run went into the local store ran by an ex adventurer, he went to the back to see the fancy swords, and asked if any looked like his holy symbol. The god he follows is illegal in that world, so I thought it would be cool if the shopkeep had one, so I narrated an old padded box that she takes out with a sword that exactly matched his holy symbol (which is a sword in a cicle). I narrated a tingling feeling when he touched it. But then I realized; he’s level two, the game has barely started, and I had him buy what seems to be a potentially extremely powerful magic item for 60 gp. I don’t want to backpedal lamely and make it weak, but it seems like a sorta dumb way to get a great item. What should I do?

To clarify, neither I nor the player know what item he has. I don’t want to make it a lame +1 sword or something, when I narraed it as something powerful. I was thinking of teiring it, at 1st teir it does nohing, second teir 1d6 extra radiant damage and +1 AC or something, add an extra d6 and armor boost per teir, by L17 itll be +3 AC an 3d6 extra radiant, but I am afraid that might be too good for something he bought and didnt even do anything to get.

Is there a legitimate reason for a USB-ethernet hardware device to have been connected to my laptop?

There was an unknown network adapter in my device manager. I found out it was for a USB-RJ45 ethernet device, which I have never even seen before. This device was not present when I bought the machine. As far as I have researched, it is not installed by any software or devices I use.

I’m concerned because there is a known vulnerability in Windows that’s exploited using these devices. A malicious person with access to the device could have stolen my credentials and logged in. (Google Usb-ethernet windows vulnerability if you don’t believe me.)

I believe the police or another malicious party exploited that vulnerability, and they used it to install a keylogger and acquire my hardware info. Is the presence of this device suspicious enough, from an information security standpoint, to support my belief? What would you do if you discovered the same on an enterprise machine?

What is the mechanical reason for rolling the same initiative for a group of creatures?

The 5th ed Players handbook states that

The GM makes one roll for an entire group of identical creatures, so each member of the group acts at the same time.

Historically in other systems I have rolled initiative for all NPC’s individually, allowing for the fact some may react quicker then there counterparts.

Has the reason for this bulk rolling of NPCs ever been explained, or is it simply a mechanic to make things run smoother?

Using lulu on osx in home business setup. Any reason for external router base firewall?

I have Lulu setup under osx on my Mac. So say an errant program, curl, if it tries to access outside address is stopped.

Would an external router based firewall bring any extra level of protection? I surmise that it will not be fine-grained enough to stop a particular process.

I believe that outgoing request are more risky than incoming request as I do not have any programming listening for request. e.g. No web server enabled.

What use would external router based firewall bring?