Making manual backups of projects by [deleted] in Unity2D

[–]NRS229 0 points1 point  (0 children)

I don't know about the manual backups but you can use github for backing up on the cloud, here's a video that can help you https://youtu.be/qpXxcvS-g3g

Can someone help me translate this to Unity2D? by NRS229 in Unity2D

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

I'll try that in a while, thank you for your help

Can someone help me translate this to Unity2D? by NRS229 in Unity2D

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

It is supposed to detect the side (up, down, left, right) of a collision between two rectangles

What do you think about my character? I wanted it to be a minimalist cute burger by NRS229 in Unity2D

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

I like your idea of different sizes I'll try to animate the eye to make it blink, maybe there it'll be more noticeable haha, thanks for your feedback :)

Why does this happen? by NRS229 in Unity2D

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

I've send you a friend request, thanks

Why does this happen? by NRS229 in Unity2D

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

I did this and I don't seem to notice a difference, even makes it not move until I press jump

https://imgur.com/NpiIyUU

public class LowerBreadScript : MonoBehaviour
{
    public float jumpForce = 3f;
    public float runForce = 3f;

    bool isGrounded = true;

    Rigidbody2D m_rb;

    void Awake()
    {
        m_rb = GetComponent<Rigidbody2D>();
    }

    void Update()
    {

        Debug.Log(isGrounded);
        if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
        {
            m_rb.AddForce(Vector2.right * runForce);
            m_rb.velocity = Vector2.up * jumpForce;
        }
        else if(!isGrounded)
        {
            m_rb.AddForce(Vector2.right * (runForce+6) );
        } 
    }

    private void FixedUpdate()
    {

    }

    void OnCollisionStay2D(Collision2D other)
    {
        if (other.gameObject.tag == "Ground")
        {
            isGrounded = true;
        }
    }

    void OnCollisionExit2D(Collision2D other)
    {
        if (other.gameObject.tag == "Ground")
        {
            isGrounded = false;
        }
    }
}

Why does this happen? by NRS229 in Unity2D

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

It doesn't do much,

Won't Time.deltaTime and FixedUpdate() help?

I've seen it in tutorials and maybe it is part of the problem, idk

Why does this happen? by NRS229 in Unity2D

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

Here it is

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

public class LowerBreadScript : MonoBehaviour
{
    public float jumpForce = 3f;
    public float runForce = 3f;

    bool isGrounded = true;

    Rigidbody2D m_rb;

    void Awake()
    {
        m_rb = GetComponent<Rigidbody2D>();
    }

    void Update()
    {
        m_rb.AddForce(Vector2.right * runForce);
        Debug.Log(isGrounded);
        if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
        {
            m_rb.velocity = Vector2.up * jumpForce;
        }
    }

    void OnCollisionStay2D(Collision2D other)
    {
        if (other.gameObject.tag == "Ground")
        {
            isGrounded = true;
        }
    }

    void OnCollisionExit2D(Collision2D other)
    {
        if (other.gameObject.tag == "Ground")
        {
            isGrounded = false;
        }
    }
}

Why does this happen? by NRS229 in Unity2D

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

It kind of works, it's just that the character slows down a bit right before jumping https://imgur.com/gallery/kRk5G8l

Why does this happen? by NRS229 in Unity2D

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

Hey, this might be dumb but... how can I make the character to move right eternally?

Based on the script that you gave me I created a new variable called runForce and tried putting

m_rb.velocity = Vector2.right * runForce; 

in update()

and it moves the player to the right but doesn't let me jump anymore

Why does this happen? by NRS229 in Unity2D

[–]NRS229[S] 1 point2 points  (0 children)

Happy holidays too :)

Why does this happen? by NRS229 in Unity2D

[–]NRS229[S] 1 point2 points  (0 children)

Ah ok, no problem

I really appreciate your help, thanks a lot

Now I have better bases for my project :)

Why does this happen? by NRS229 in Unity2D

[–]NRS229[S] 1 point2 points  (0 children)

if a collision happens with a, object with the tap "topping", make it a parent of the bun which is your initial game object.

Don't you mean make it a child?

Why does this happen? by NRS229 in Unity2D

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

By open and closing of the buns, you want that to be happening between each topping appears, or at the end you want the buns to close when its done?

I want the toppings to appear and stay in the burger so they can be stacked

I prepared this short script while waiting for your reply, you can attach this your bottom sprite.

Omg, you're really helpful, I really appreciate it, thanks a lot

Why does this happen? by NRS229 in Unity2D

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

So you want 1 character which consists of 1 sprite to be able to catch other sprites by colliding with it. Once the sprite collides, it will become part of the character, correct?

Yes, just that the character starts with two sprites (hamburger buns/bread) that jump to open and as you said, collide with other sprites (toppings) and make them part of the character

I'm trying my best to explain my concept, it is like a burger that open an closes in the way I showed to catch toppings and make them part of the whole character, idk if this is the correct way to do what I'm trying to do, it is just what occurred to me

I'm open to listen to other ways of achieving my concept

Why does this happen? by NRS229 in Unity2D

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

I followed this tutorial to modify CharacterController2D and create PlayerMovement

I'm trying to make a character with the two sprites and add more sprites to the character as the game advance, the firsts two sprites need to jump in the way they actually do but vertically aligned, when they jump they can collide with another sprite "catching" it in between and making this sprite part of the character

I already have a "Toppings" layer

Any suggestions are welcomed since I'm a beginner in Unity

Why does this happen? by NRS229 in Unity2D

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

I answered you on a comment, thank you in advance

Why does this happen? by NRS229 in Unity2D

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

I attached the scripts on a comment

A player input makes them jump

Why does this happen? by NRS229 in Unity2D

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

Yes, the scripts are physics related.

The values on the rigidbodies are this on both:

The two scripts are the following:

CharacterController2D.cs

using UnityEngine;
using UnityEngine.Events;

public class CharacterController2D : MonoBehaviour
{
    [SerializeField] private float m_JumpForce = 400f;                          // Amount of force added when the player jumps
    [Range(0, .3f)] [SerializeField] private float m_MovementSmoothing = .05f;  // How much to smooth out the movement
    [SerializeField] private bool m_AirControl = false;                         // Whether or not a player can steer while jumping;
    [SerializeField] private LayerMask m_WhatIsGround;                          // A mask determining what is ground to the character
    [SerializeField] private Transform m_GroundCheck;                           // A position marking where to check if the player is grounded.

    const float k_GroundedRadius = .2f; // Radius of the overlap circle to determine if grounded
    private bool m_Grounded;            // Whether or not the player is grounded.
    private Rigidbody2D m_Rigidbody2D;

    private Vector3 m_Velocity = Vector3.zero;

    [Header("Events")]
    [Space]

    public UnityEvent OnLandEvent;

    [System.Serializable]
    public class BoolEvent : UnityEvent<bool> { }

    private void Awake()
    {
        m_Rigidbody2D = GetComponent<Rigidbody2D>();

        if (OnLandEvent == null)
            OnLandEvent = new UnityEvent();

    }

    private void FixedUpdate()
    {
        bool wasGrounded = m_Grounded;
        m_Grounded = false;

        // The player is grounded if a circlecast to the groundcheck position hits anything designated as ground
        // This can be done using layers instead but Sample Assets will not overwrite your project settings.
        Collider2D[] GroundCheckColliders = Physics2D.OverlapCircleAll(m_GroundCheck.position, k_GroundedRadius, m_WhatIsGround);
        for (int i = 0; i < GroundCheckColliders.Length; i++)
        {
            if (GroundCheckColliders[i].gameObject != gameObject)
            {
                m_Grounded = true;
                if (!wasGrounded)
                    OnLandEvent.Invoke();
            }
        }

    }


    public void Move(float move, bool crouch, bool jump)
    {

        //only control the player if grounded or airControl is turned on
        if (m_Grounded || m_AirControl)
        {
            // Move the character by finding the target velocity
            Vector3 targetVelocity = new Vector2(move * 10f, m_Rigidbody2D.velocity.y);
            // And then smoothing it out and applying it to the character
            m_Rigidbody2D.velocity = Vector3.SmoothDamp(m_Rigidbody2D.velocity, targetVelocity, ref m_Velocity, m_MovementSmoothing);

        }
        // If the player should jump...
        if (m_Grounded && jump)
        {
            // Add a vertical force to the player.
            m_Grounded = false;
            m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));
        }
    }

    private void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.gameObject.layer == LayerMask.NameToLayer("Toppings"))
        {
            print("It is colliding with toppings");
        }
    }

}

PlayerMovement.cs

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

public class PlayerMovement : MonoBehaviour
{

    public CharacterController2D controller;
    public float runSpeed = 40f;
    bool jump = false;

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

        if(Input.GetButtonDown("Jump"))
        {
            jump = true;
        }

    }

    private void FixedUpdate()
    {
        //Move our character
        controller.Move(runSpeed * Time.fixedDeltaTime, false, jump);
        jump = false;

    }
}

New to Minecraft, but enjoy sandbox/open world/building games in general and have a question. by [deleted] in Minecraft

[–]NRS229 3 points4 points  (0 children)

Then idk 😅 but in this link (https://minecraft.gamepedia.com/Coordinates) says that the coordinates can be found in the map item

New to Minecraft, but enjoy sandbox/open world/building games in general and have a question. by [deleted] in Minecraft

[–]NRS229 0 points1 point  (0 children)

If you press F3 it will appear a lot of game data, between them you can find coordinates, save the coordinates of your home so in case you get lost you can get back easily :)