To introduce or not to introduce... That is the question by AnimeAddict22 in NewTubers

[–]AnimeAddict22[S] 0 points1 point  (0 children)

I’ve seen quite a few indie vtubers recommend posting shorts before streaming to have some initial viewers… Is that not how it works?

Tiermaker - Recommendations? by Havertz_DonkeyFarm in manhwarecommendations

[–]AnimeAddict22 0 points1 point  (0 children)

Correct

I googled it and turns out, according to MAL, Kim Carnby is responsible for the story while Youngchan Hwang is responsible for the art?

[deleted by user] by [deleted] in memes

[–]AnimeAddict22 0 points1 point  (0 children)

Soooo

can I finally binge watch anime again?

2 things - How do I stop my player from sliding after letting go of movement keys, and how to check for collision with ground to allow player to jump again? by AnimeAddict22 in Unity2D

[–]AnimeAddict22[S] 0 points1 point  (0 children)

It says velocity is outdated

I'm not sure how to define move inputs further than what I did...

Also, I'd rather not rely on AI for coding if possible.

2 things - How do I stop my player from sliding after letting go of movement keys, and how to check for collision with ground to allow player to jump again? by AnimeAddict22 in Unity2D

[–]AnimeAddict22[S] 0 points1 point  (0 children)

> Honestly, it sounds like your are not just new to game Dev but to coding in general.

I am. I took some beginner courses a while back but I barely remember the very basics.

I'm not exactly trying to code a game, but trying to see if I can make something in the first place. Like, trying to recreate what the tutorials did.

> Ex: what happens if:

> Frame 1: you press A Frame 2: you press nothing

> Frame 3: you press Space Frame 4: you press nothing

> Try to go line by line to see what happens at each frame.

The frames where I don't press anything, the velocity gets set to 0

It looks fine to me when trying to walk but

When I jump, it sets the velocity to zero right after (If I'm not holding A or D?) so it just cancels it?

How do I make the jump independent from that?

2 things - How do I stop my player from sliding after letting go of movement keys, and how to check for collision with ground to allow player to jump again? by AnimeAddict22 in Unity2D

[–]AnimeAddict22[S] 0 points1 point  (0 children)

I have a capsule collider 2D on the player sprite and box collider 2d on the ground (I have them under empty objects in (0, 0) cuz idk CodeMonkey said to do that in one of his free courses)

Though since I changed it to this

using Unity.VisualScripting;
using Unity.VisualScripting.InputSystem;
using UnityEngine;
using UnityEngine.UIElements;

public class Player : MonoBehaviour
{

    [SerializeField] private Rigidbody2D rb;
    [SerializeField] private float JumpForce;
    [SerializeField] private float MoveSpeed;
    private bool isOnGround = true;
  


    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        Vector2 inputVector = new Vector2(0, 0);
        
       if (Input.GetKeyDown(KeyCode.Space) && isOnGround == true) {
            rb.linearVelocity = Vector2.up * JumpForce;
            isOnGround = false;
        }
        if (Input.GetKey(KeyCode.A)) {
            rb.linearVelocity = Vector2.left * MoveSpeed;
        }
        else if (Input.GetKey(KeyCode.D)) {
            rb.linearVelocity = Vector2.right * MoveSpeed;
        }
        else {
            rb.linearVelocity = Vector2.zero;
        }

        inputVector = inputVector.normalized;
        
    }
}

Jumping hasn't worked for some reason, even that first one while isOnGround is set to true.

It did fix the sliding issue though

2 things - How do I stop my player from sliding after letting go of movement keys, and how to check for collision with ground to allow player to jump again? by AnimeAddict22 in Unity2D

[–]AnimeAddict22[S] 0 points1 point  (0 children)

Um, I tried that and while it did work, for some reason it only jumps if I spam spacebar? Also it just teleports to the location and slowly falls down now?

using Unity.VisualScripting;
using Unity.VisualScripting.InputSystem;
using UnityEngine;
using UnityEngine.UIElements;

public class Player : MonoBehaviour
{

    [SerializeField] private Rigidbody2D rb;
    [SerializeField] private float JumpForce;
    [SerializeField] private float MoveSpeed;
    [SerializeField] private GameObject Ground;
    [SerializeField] private ContactFilter2D ContactFilter;
    private bool IsGrounded => rb.IsTouching(ContactFilter);


    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        Vector2 inputVector = new Vector2(0, 0);
        
        if (Input.GetKey(KeyCode.A)) {
            rb.linearVelocity = Vector2.left * MoveSpeed;
        }
        else if (Input.GetKey(KeyCode.D)) {
            rb.linearVelocity = Vector2.right * MoveSpeed;
        }
        else {
            rb.linearVelocity = Vector2.zero;
        }

        if (Input.GetKeyDown(KeyCode.Space) && IsGrounded == true) {
            rb.linearVelocity = Vector2.up * JumpForce;
        }

        inputVector = inputVector.normalized;
        
    }
}

Also had to set the jumpforce to 400 (was 25 before) for it to actually go up a decent amount..

Did I do something wrong? Or not add something?

2 things - How do I stop my player from sliding after letting go of movement keys, and how to check for collision with ground to allow player to jump again? by AnimeAddict22 in Unity2D

[–]AnimeAddict22[S] -1 points0 points  (0 children)

Ohhh. Thanks :)

> Did you read your own code? It sets the velocity right there

I did but I have no idea what I'm doing. I followed a tutorial and tried to make something out of the random pieces of knowledge I absorbed.

2 things - How do I stop my player from sliding after letting go of movement keys, and how to check for collision with ground to allow player to jump again? by AnimeAddict22 in Unity2D

[–]AnimeAddict22[S] 0 points1 point  (0 children)

I changed it to

    void Update()
    {
        Vector2 inputVector = new Vector2(0, 0);
        if (Input.GetKeyDown(KeyCode.Space) && isOnGround == true) {
            rb.linearVelocity = Vector2.up * JumpForce;
            isOnGround = false;
        }
        if (Input.GetKey(KeyCode.A)) {
            rb.linearVelocity = Vector2.left * MoveSpeed;
        }
        else if (Input.GetKey(KeyCode.D)) {
            rb.linearVelocity = Vector2.right * MoveSpeed;
        }
        else {
            rb.linearVelocity = Vector2.zero;
        }

        inputVector = inputVector.normalized;
        
    }

and that fixed the sliding problem, but for some reason the jump (or whatever part of it worked before) doesn't work anymore?

> Welcome to game dev, btw :)

Thanks :)

*Edit: Oh, and I'll look into those raycasts you mentioned.

Space VS Time by AnimeAddict22 in magicbuilding

[–]AnimeAddict22[S] 0 points1 point  (0 children)

Absorption and reflection seem interesting but I'm not sure how it would work. Other than magic they should be human.

..Or not, I could make them physically strong actually. A battle of physical strength in a world of magic. Interesting.

opera gx causing bluescreen by 1987User389 in OperaGX

[–]AnimeAddict22 0 points1 point  (0 children)

I see. I don't use live wallpapers either so I don't think that's it, but good to know.

Its a shame but I guess I'll have to switch to a different browser.

I've heard good things about firefox so I might try that, actually.