How can I create a walking zone logic for my player?

First I will show a screenshot and explain the logic I think of and what I’m trying to do :


The small circle is the Player.

The black rectangle is the target the player is walking towards.

The green zone is where the player slow down. Once entering the green zone and facing the target by calculating the distance from the target the player start slowing down until stop.

When the player just rotating facing the opposite direction away from the target in this point something show switch the speed logic if the player was slow down to stop if the player is facing the opposite direction he can start walking again and the speed should be increasing slowly to the normal speed the same idea when slowing down to stop so speed up to normal.

Now if the player is leaving the green zone once left the green zone using a flag or some helper and reset everything so if the player will enter the green zone again facing the target he will slow down to stop again.

  • When the player is getting some distance from the target and facing the target slow down to stop.

  • When the player stopped and then if the player rotating facing the opposite direction let the player the option to move again with increasing the speed back to normal.

  • When the player is moving away from the target some distance for example out the green zone reset everything and if the player will face the target again and enter the green zone as distance from target slow down to stop again.

This script is attached to some object and make the logic I wanted :

using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine;  public class FireEffect : MonoBehaviour {     public GameObject player;     public GameObject longDistanceDescriptionTextImage;     public TextMeshProUGUI text;      private Animator playerAnimator;     private float timeElapsed = 0;     private float lerpDuration = 3;     private float startValue = 1;     private float endValue = 0;     private float valueToLerp = 0;     private float angle;      // Start is called before the first frame update     void Start()     {         angle = transform.eulerAngles.y;         playerAnimator = player.GetComponent<Animator>();     }      // Update is called once per frame     void Update()     {         var distance = Vector3.Distance(player.transform.position, transform.position);          Vector3 dir = (transform.position - player.transform.position).normalized;         float dot = Vector3.Dot(dir, player.transform.forward);          angle = transform.eulerAngles.y;         if (distance < 10 && dot > 0.9f)         {             if (timeElapsed < lerpDuration)             {                 valueToLerp = Mathf.Lerp(startValue, endValue, timeElapsed / lerpDuration);                 playerAnimator.SetFloat("Forward", valueToLerp);                 timeElapsed += Time.deltaTime;             }             playerAnimator.SetFloat("Forward", valueToLerp);             longDistanceDescriptionTextImage.SetActive(true);             text.text = "It's too hot , I can't continue.";         }         else         {             if (dot < -0.9f)             {                 if (timeElapsed > lerpDuration)                 {                     valueToLerp = Mathf.Lerp(endValue, startValue, timeElapsed / lerpDuration);                     playerAnimator.SetFloat("Forward", valueToLerp);                     timeElapsed += Time.deltaTime;                 }                 playerAnimator.SetFloat("Forward", valueToLerp);             }         }     } } 

I’m not sure if this is the right way to make the script but it does working for the slow down to stop part :

if (distance < 10 && dot > 0.9f)         {             if (timeElapsed < lerpDuration)             {                 valueToLerp = Mathf.Lerp(startValue, endValue, timeElapsed / lerpDuration);                 playerAnimator.SetFloat("Forward", valueToLerp);                 timeElapsed += Time.deltaTime;             }             playerAnimator.SetFloat("Forward", valueToLerp);             longDistanceDescriptionTextImage.SetActive(true);             text.text = "It's too hot , I can't continue.";         } 

but it’s not working in the else part the speed is not increasing slowly back to normal but increasing at once to normal. The lerp is not working for the increasing back.

another problem is when the player in the else part facing away from the target if I will rotate the player with the keys and move him again to the target he will walk regular nonstop to the target without slow down again.

I’m not sure what logic should be here for 100% but I think if the player is facing away from the target start increasing to normal speed and if in the middle I rotate the player facing the target again because I’m inside the green zone then slow down to stop the player maybe a bit faster to keep the same 10 distance like in the script from the target. Don’t let the player to pass over the 10 distance from the target when facing the target.

Can the Command spell force someone to answer a question in a Zone of Truth?

If you have an enemy in a Zone of Truth who failed their save, they can still choose to not answer. If a player casts Command on them with the word being "answer" would that force the creature to answer the question posed? Similarly, what if you cast the command "lie" on a creature in a Zone of Truth?

Is the caster of Zone of Truth aware of the save result?

If I cast this spell, will I be able to tell whether the target saved or not?

The spell level and therefore the DC will be too low so my intention it to use it for negotiations where the target and myself both decide to fail it to make the negotiations more reliable.

In case I can’t be aware of the result (which makes the spell completely useless since everyone can save it), is there some other spell that can be used to reliably prevent lies?

Health zone heals player but I have a problem

Hello I am creating a special health zone that gives the player health and my current scripts health is going up super fast and I want it to go up by 2 hp per second. How would I do this?

Here is the health zone script.

{     public PlayerHealth playerHealth;     public float healthGain = 2f;          void OnTriggerStay2D(Collider2D other)     {         if (playerHealth.currentHealth < playerHealth.maxHealth)         {             playerHealth.currentHealth += (int)healthGain;             playerHealth.healthBar.SetHealth(playerHealth.currentHealth);         }          if (playerHealth.currentHealth >= playerHealth.maxHealth)         {             playerHealth.currentHealth = playerHealth.maxHealth;             playerHealth.healthBar.SetHealth(playerHealth.currentHealth);         }     } } 

Animate Dead in a zone affected by Hallow?

The hallow spell prevents undead from entering a certain area:

First, celestials, elementals, fey, fiends, and undead can’t enter the area, nor can such creatures charm, frighten, or possess creatures within it. Any creature charmed, frightened, or possessed by such a creature is no longer charmed, frightened, or possessed upon entering the area. You can exclude one or more of those types of creatures from this effect.

In addition, it has an optional effect to prevent dead bodies interred within from becoming undead:

Everlasting Rest. Dead bodies interred in the area can’t be turned into undead.

Assuming the caster of hallow did not select the Everlasting Rest option, if a character casts animate dead on a corpse within a hallow zone, what happens to the resulting zombie or skeleton?

Test Your Domain’s DNS Zone Health

Setting up DNS is easy, isn't it? Many times you do not even do it, because your hosting does it for you. You then just check your site is accessible and that's it. But DNS is quite a complex system and there are issues you might not even know they existed. The fact that it works for you perfectly does not necessarily means that it works for everyone.

You can now check your DNS Zone with our new tool called DNS Zone Health Checker….

Test Your Domain's DNS Zone Health

Transfer requests for localhost zone on my bind DNS server

I use Debian stretch and Bind 9.10.3 as my DNS server.

Today I saw the following entry in my log file:

Apr 17 23:04:22 ns named[111]: client (localhost): transfer of 'localhost/IN': AXFR started (serial 2) Apr 17 23:04:22 ns named[111]: client (localhost): transfer of 'localhost/IN': AXFR ended 

The IP address belongs to zone and whois points to INTERNET-RESEARCH-NET.

  1. Do I need to be concerned?
  2. Why do they transfer the localhost zone?
  3. Why is this transfer successful? (*)

(*) My config is largely the default Debian one. Importantly I have not modified the stock named.conf.default-zones file, i.e. no transfers should be allowed at all:

zone "localhost" {         type master;         file "/etc/bind/db.local"; }; 

Best Firewall Zone Settings for Security Gli-net Routers

I believe many will benefit from this as there is not clear answer online and I keep making my policies too strong and locking myself out from accessing the LAN admin panel.

What would be the absolute strongest security settings without locking myself out on the Firewall Zone settings.

The settings go as follows and the options are either accept, reject, or drop. Could someone explain each of the categories so I know what is happening in each and what it is used for? I want to specify that I want to block all inbound connections as I do not have a need for them (close all uneccessary ports and exterior ports that are for inbound connections/remote connections)

This is the panels format:

Zone. Input Output Forward

LAN. Option Option. Option

WAN. Option. Option Option

Guest Option. Option Option

OVPN. Option. Option. Option