unity – Combining Rotation, Jump, and Crouch Animations with 2D Blend Tree

I have a 2D Freeform Blend Tree that I’m using to animate a character that can currently:

  • Walk / Sprint Forward
  • Walk / Sprint Backward
  • Strafe / Sprint Strafe Left
  • Strafe / Sprint Strafe Right
  • Idle

My goal is to add in rotation, jump, crouch, and “firing when walking” animations.

In just dealing with turning or even jumping for now, I understand how to handle and call the animations in the code, but not sure of how it should be set up in the animator.

Do I transition to rotation/jump animations on the base layer? I’m reserved doing it this way because I lose the ability to blend and take advantage of those transitions.
Can I build it into my current 2D blend tree even though the blend tree is only X and Z axis?

enter image description here

public class twoDControllerMovement : MonoBehaviour
    Animator animator;
    public CharacterController controller;

    (SerializeField) private float walkSpeed = 12.0f;
    (SerializeField) private float strafeSpeed = 10.0f;
    (SerializeField) private float sprintMultipler = 2.0f;
    (SerializeField) private float rotationSpeed = 120.0f;

    // Start is called before the first frame update
    void Start()
        animator = GetComponent<Animator>();
        controller = GetComponent<CharacterController>();

    // Update is called once per frame
    void Update()

        // handle sprint
        float currentWalkSpeed = walkSpeed;
        float currentStrafeSpeed = strafeSpeed;
        bool runPressed = false;

        // handle shift
        if (Input.GetKey(KeyCode.LeftShift))
            currentWalkSpeed = walkSpeed * sprintMultipler;
            currentStrafeSpeed = strafeSpeed * sprintMultipler;
            runPressed = true;

        // calculate movement
        float strafe = Input.GetAxis("Strafe") * currentStrafeSpeed * Time.deltaTime;
        float translation = Input.GetAxis("Vertical") * currentWalkSpeed * Time.deltaTime;
        float rotation = Input.GetAxis("Horizontal") * rotationSpeed * Time.deltaTime;

        // execute movement
        transform.Translate(strafe, 0f, translation);
        transform.Rotate(0, rotation, 0f);

        // handle movement animations
        if (runPressed) {
            animator.SetFloat("VelocityZ", Input.GetAxis("Vertical") * sprintMultipler);
            animator.SetFloat("VelocityX", Input.GetAxis("Strafe") * sprintMultipler);
        } else 
            animator.SetFloat("VelocityZ", Input.GetAxis("Vertical"));
            animator.SetFloat("VelocityX", Input.GetAxis("Strafe"));

        // handle roration animations
        if (Input.GetAxis("Horizontal") < 0.1f)
        } else if (Input.GetAxis("Horizontal") > 0.1f)


Also open to any feedback on improving the code above, my goal is as small and clean as possible! I do have a slight delay in animations starting when switching directions that I have to work out at some point and would eventually.

google sheets – jump to cell using dropdown list data validation

I’m trying to create a data validation/dropdown list to jump to a specific cell.

I have a large spreadsheet that I need to navigate around, and it is client facing. I’d love to have a dropdown list based off a data validation that could jump to a specific cell so that navigation is a little more straightforward.

I know you can type do “help/go to range” and jump to a specific cell,

But I’m hoping to create a dropdown menu that isn’t hyperlink based. Something that says the content of the cell not just its name.

For instance, I want to jump to cell A9, but would like it to say the text of B9 which in this example is “shot001_001”

So the data validation would be a list of Shot_001_001, Shot_001_002, Shot_001_003 etc. (names will change later) But the function would be the same as “go to range”

is that even possible?

airlines – Why do return ticket prices jump up if the return flight is more than six months after the departing flight?

On Singapore Airlines, if you book a flight from London to Singapore for almost any date, the price is either £690 or £1088. For example, a flight leaving on the 28th of Dec with return on 28th of June costs £690 but changing either date to make the trip duration longer than six months by even one day increases the price to £1088.

I realize this is only one example but I don’t think it’s an isolated case. Four years ago, there was a question that seemed to ask something similar but didn’t state it clearly. Why do airlines have such a policy?

seo – Using Anchor Links aka Jump To Links with Internal Linking Strategy

Do anchor links that link to another page help or hurt SEO internal linking strategy?

For example, let’s say I have two pages:
example.com/services, and

And, on /subtopic-service I have anchor links like:

And, I link to that anchor like from the higher level page /services.

I know that anchor links aren’t indexed. But, will I get the same SEO benefit from an internal link with an anchor link?

Character Jump (AddForce) unusual behavior near objects in unity 2D

so my character object has a single jump mechanics , I just noticed the whenever I press the jump button many times quickly in which the character is near a “Platforms like staircase , boxes or even sometime near the edge of a platform (while also being up in the air and pressing jump many times when colliding)” it starts to fly off beyond my jump force. anyone can teach and help me to fix this physics? thanks

my Jump system code sample is very much like this :

Rigidbody2D mybody;
public float jumpforce;

public bool isGrounded = false;
public Transform feet;
public LayerMask groundlayers;
public float groundradius = 1f;
bool Jumprequest;

    void Start () {
    mybody = GetComponent<Rigidbidy2D>();


    void Update () {



void FixedUpdate() {

    isGrounded = Physics2D.OverlapCircle(feet.position, groundradius, groundlayers);


public void JumpRequest() {
    if (CrossPlatformInputManager.GetButtonDown("Jump") && isGrounded)
        isGrounded = false;
        Jumprequest = true;

void Jump()
    if (Jumprequest)
        mybody.AddForce(new Vector2(0, jumpforce) , ForceMode2D.Impulse);

    Jumprequest = false;

void JumpOptimization() {

    if (mybody.velocity.y < 0)
        mybody.gravityScale = Fallmultiplier;
        mybody.gravityScale = 1;

Here is a sample picture that might help:
The red line shows when character collided with an object while addforce is added upwards and pressing
Jump button repeatedly at the same time, the character flies off beyond my jumpforce.

enter image description here

dnd 5e – Is the satyr’s Mirthful Leaps trait affected by jump multipliers?

I would make the argument that when Boots of Striding and Springing says

you can jump three times the normal distance,

this is referring to your unmodified (normal) jump distance, to which you may then add modifiers.

I believe if the Boots multiplied the modifiers as well, it would read similar to the Jump spell:

the creature’s jump distance is tripled

Jump triples your jump distance for its duration, modifiers included; if it was intended to triple your distance without first accounting for modifiers it would read as the Boots do, using the word “normal”.

Thanks to Medix2 for helping with clarity.

c – Erro “cannot jump from switch statement to this case label” ao adicionar outro case ao meu switch

Estou tentando adicionar outro case ao meu switch, porem apresenta esse erro acima. já verifiquei e não falta nenhum break nos cases anteriores. Porem, se eu excluir somente o case anterior ele não mais apresenta esse erro. Abaixo segue o código do case anterior.

case 5:
      printf("nDigite o valor da Largura e Comprimento da sala de aula e a distancia minima em metros recomendada respectivameten");
    scanf("%f %f %f", &Largura, &Altura, &Distancia_Minima);
    Semanas_Para_Fechar_O_Ciclo = ceil ((float) Cont_Quantidade_Aluno(Aln) / ((Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1)));
    printf("nnA turma com %d aluno(s) do nao grupo de risco foi dividida em %d grupo(s) para que haja o distanciamento adequado na sala de aula levando em consideracao a area da sala de aula e a distancia minima entre duas carteiras, sera preciso uma quantidade de %d semana(s) para que todos os alunos tenham a mesma quantidade de aulann",Cont_Quantidade_Aluno(Aln), Semanas_Para_Fechar_O_Ciclo, Semanas_Para_Fechar_O_Ciclo);
    printf("nnO grupo de alunos do grupo de risco contem uma quantidade de %d aluno(s) e eles deverão assistir as aulas de forma remotann",Cont_Quantidade_Aluno(Alunos_Grupo_De_Risco));
    //printf("nQuantidade de alunos cadastrados = %dn", Cont_Quantidade_Aluno(Aln));
    //printf("nQuantidade maxima de alunos menos o professor = %dn", Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1);
    //printf("nProporcao de alunos na turma = %dn", Semanas_Para_Fechar_O_Ciclo);
    char Alocacao(Semanas_Para_Fechar_O_Ciclo)(Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1)(41);
    Aloca_Turma(Aln, (Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1), Semanas_Para_Fechar_O_Ciclo, Alocacao);
    //int L = Semanas_Para_Fechar_O_Ciclo;
    //int C = (Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1);
    //printf("nnLinhas = %d Colunas = %d", L, C);
    //for(i = 0; i < Semanas_Para_Fechar_O_Ciclo; i++){
    //  printf("nnTurma de numero %dnn", (i+1));
    //  for (j = 0; j < (Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1); j++){
    //    printf("nnPosicao (%d)(%d)Alunos = %s nn",i,j, Alocacao(i)(j));
    //  }
    Imprime_Turma_Alocada(Semanas_Para_Fechar_O_Ciclo, (Quantidade_Alunos_Sala(Altura, Largura, Distancia_Minima) - 1), Alocacao, Dias_Letivo, Horario_Escolar);

unity – Why the player clings to the ground and cannot jump?

I’m making a 2D platformer with Unity. I used this tutorial to write the code but with some changes like using the new Input System. Like the tutorial, I defined three variables called GroundedRememeber, JumpPressedRemember and JumpPressedRememberTime and basically they work like timers and check if the player leaves the ground and if so, then the player can jump when it is near the ground without the need to touch it. But the problem is that these timers are not working and the player cannot jump, just clings to the ground.

Here’s my Player Controller script:

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

public class PlayerController : MonoBehaviour, PlayerInputActions.IPlayerActions
   private PlayerInputActions controls; 
   (SerializeField) LayerMask groundLayers;     
   private Rigidbody2D rb;
   private Animator anim;
   private bool facingRight = true;
   private Vector2 moveInput;
  (SerializeField) private float jumpForce;
    float JumpPressedRemember = 0;
   (SerializeField) float JumpPressedRememberTime = 0.2f;
    float GroundedRemember = 0;
   (SerializeField)  float GroundedRememberTime = 0.25f;  
   (SerializeField)  float HorizontalAcceleration = 1;
   (SerializeField) (Range(0, 1)) float HorizontalDampingBasic = 0.5f;
   (SerializeField) (Range(0, 1)) float HorizontalDampingWhenStopping = 0.5f;
   (SerializeField) (Range(0, 1)) float HorizontalDampingWhenTurning = 0.5f;
   (SerializeField) (Range(0, 1)) float JumpHeight = 0.5f;

   private void Awake() 
      controls = new PlayerInputActions();

     void Start()
      rb = GetComponent<Rigidbody2D>();
      anim = GetComponent<Animator>();       
   void PlayerInputActions.IPlayerActions.OnMove(InputAction.CallbackContext context)
      moveInput = context.ReadValue<Vector2>();
     bool TryJump() {
    if (GroundedRemember > 0) {
        return true;
    } else {
        JumpPressedRemember = JumpPressedRememberTime;
        return false;
     void PlayerInputActions.IPlayerActions.OnJump(InputAction.CallbackContext context)
       jumpForce = context.ReadValue<float>();
       switch (context.phase) {
            case InputActionPhase.Performed:
   void Jump() {
     rb.AddForce(Vector2.up * jumpForce, ForceMode2D.Force);
     GroundedRemember = 0;
     JumpPressedRemember = 0;
  void FixedUpdate()

   if(facingRight == false && moveInput.x > 0){
   }else if (facingRight == true && moveInput.x < 0){

    void Flip(){
    facingRight = !facingRight;
    Vector3 Scaler = transform.localScale;
    Scaler.x *= -1;
    transform.localScale = Scaler;
 void OnEnable()
 void OnDisable()
 void Update()

   Vector2 GroundedBoxCheckPosition = (Vector2)transform.position + new Vector2(0, -0.01f);
   Vector2  GroundedBoxCheckScale = (Vector2)transform.localScale + new Vector2(-0.02f, 0);
   bool Grounded = Physics2D.OverlapBox(GroundedBoxCheckPosition, transform.localScale, 0, groundLayers);
    GroundedRemember -= Time.deltaTime;
    if (Grounded)
      GroundedRemember = GroundedRememberTime;

    JumpPressedRemember -= Time.deltaTime; 
    if ((JumpPressedRemember > 0)) {

    rb.velocity = new Vector2(rb.velocity.x, jumpForce);
     float HorizontalVelocity = rb.velocity.x;
      HorizontalVelocity += moveInput.x;
     if (Mathf.Abs(moveInput.x) < 0.01f)
            HorizontalVelocity *= Mathf.Pow(1f - HorizontalDampingWhenStopping, Time.deltaTime * 10f);
           else if (Mathf.Sign(moveInput.x) != Mathf.Sign(HorizontalVelocity))
           HorizontalVelocity *= Mathf.Pow(1f - HorizontalDampingWhenTurning, Time.deltaTime * 10f);
            HorizontalVelocity *= Mathf.Pow(1f - HorizontalDampingBasic, Time.deltaTime * 10f);

        rb.velocity = new Vector2(HorizontalVelocity, rb.velocity.y);    

This is the original code from the tutorial which is using the old Input System:

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

public class PlayerMovement : MonoBehaviour
    LayerMask lmWalls;
    float fJumpVelocity = 5;

    Rigidbody2D rigid;

    float fJumpPressedRemember = 0;
    float fJumpPressedRememberTime = 0.2f;

    float fGroundedRemember = 0;
    float fGroundedRememberTime = 0.25f;

    float fHorizontalAcceleration = 1;
    (Range(0, 1))
    float fHorizontalDampingBasic = 0.5f;
    (Range(0, 1))
    float fHorizontalDampingWhenStopping = 0.5f;
    (Range(0, 1))
    float fHorizontalDampingWhenTurning = 0.5f;

    (Range(0, 1))
    float fCutJumpHeight = 0.5f;

    void Start ()
        rigid = GetComponent<Rigidbody2D>();
    void Update ()
        Vector2 v2GroundedBoxCheckPosition = (Vector2)transform.position + new Vector2(0, -0.01f);
        Vector2 v2GroundedBoxCheckScale = (Vector2)transform.localScale + new Vector2(-0.02f, 0);
        bool bGrounded = Physics2D.OverlapBox(v2GroundedBoxCheckPosition, v2GroundedBoxCheckScale, 0, lmWalls);

        fGroundedRemember -= Time.deltaTime;
        if (bGrounded)
            fGroundedRemember = fGroundedRememberTime;

        fJumpPressedRemember -= Time.deltaTime;
        if (Input.GetButtonDown("Jump"))
            fJumpPressedRemember = fJumpPressedRememberTime;

        if (Input.GetButtonUp("Jump"))
            if (rigid.velocity.y > 0)
                rigid.velocity = new Vector2(rigid.velocity.x, rigid.velocity.y * fCutJumpHeight);

        if ((fJumpPressedRemember > 0) && (fGroundedRemember > 0))
            fJumpPressedRemember = 0;
            fGroundedRemember = 0;
            rigid.velocity = new Vector2(rigid.velocity.x, fJumpVelocity);

        float fHorizontalVelocity = rigid.velocity.x;
        fHorizontalVelocity += Input.GetAxisRaw("Horizontal");

        if (Mathf.Abs(Input.GetAxisRaw("Horizontal")) < 0.01f)
            fHorizontalVelocity *= Mathf.Pow(1f - fHorizontalDampingWhenStopping, Time.deltaTime * 10f);
        else if (Mathf.Sign(Input.GetAxisRaw("Horizontal")) != Mathf.Sign(fHorizontalVelocity))
            fHorizontalVelocity *= Mathf.Pow(1f - fHorizontalDampingWhenTurning, Time.deltaTime * 10f);
            fHorizontalVelocity *= Mathf.Pow(1f - fHorizontalDampingBasic, Time.deltaTime * 10f);

        rigid.velocity = new Vector2(fHorizontalVelocity, rigid.velocity.y);

dnd 5e – Can I cast a spell in the middle of jumping with a Jump spell?

Since Thunderwave includes somatic components, I would be careful about that.

Somatic (S)

Spellcasting gestures might include a forceful gesticulation or an intricate set of gestures. If a spell requires a somatic component, the caster must have free use of at least one hand to perform these gestures.

If you go with the rule that the cast must have at least one hand, then maybe you can allow the casting in the air. However, if you try jumping, in real life, you’ll notice that you use both arms to and you cannot really release the muscle bending in your arms until you land.

Now, if you accumulate the at least one hand and intricate set of gestures, I think it makes it pretty clear that while jumping, it’s going to be really hard to cast a spell with a Somatic element, unless that somatic is in link with jumping (i.e. the jump is what invokes the magic of that spell). Either that, or the wizard is going to end up falling instead of landing on his feet.

So, jump, land, cast would make a lot more sense to me.

That being said, you could have some form of house rule that with training the spell caster could do it. Or maybe make that possible by calling it a feat. That means the player has to be human (if you allow them to have a feat at level 1) or reach level 4 to get the feat. The feat could give you a +1 Dexterity and the ability of casting spells while walking, running, jumping, falling… in movement.

Don’t forget that if your players can do it, so can monsters.

paging – Alter comment pager to jump to comment section right away?

I set up a content type and a specific comment type for this content. I set the comment pager to display 10 comments per page. When I now use the pager, I get redirected from the node URL itself www.domain.com/node/1, to www.domain.com/node/1?page=1.

Is there any possibility to add an ID to the URL for the comments pager only, for example www.domain.com/node/1?page=1#comments?

I want to do this, so the user doesn’t need to scroll over the whole content of the node again, just to get to the second comments page. Instead, I want to jump to the comment section right away.

Is there any elegant way to do so? A module that does it, or similar? I already thought of altering the pager.html.twig in my theme. But then I would alter the node pager as well.
Thank you very much in advance for pointing me any way to achieve this.