r/Unity3D – Telegram
r/Unity3D
258 subscribers
12.6K photos
15.5K videos
14 files
47.9K links
News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
Download Telegram
Unity netcode (ngo) for objects

Hey guys ,

So i was wondering , when creating a multiplayer game with netcode for gameobjects i see that when you close a client the player will despawn (get destroyed) immediately.

I was wondering if there was an easy way to make it not be destroyed immediately but stay in the game for x amount of time for which i could then make a noscript that will save the players stats , info and location before being destroyed?

Thanks for taking the time to read this question.

https://redd.it/1jxpdny
@r_Unity3D
Trying to make my player launch towards an object but it only launches vertically.

Hi, so I have this player movement noscript but when the launchTowardsHook() function is called it only launches the player vertically even though its getting the launch direction correctly.

using UnityEngine;
using UnityEngine.UIElements;

public class PlayerController : MonoBehaviour
{
    private Rigidbody2D RB;
    SerializeField private float playerSpeed = 5f;
    SerializeField private float jumpForce = 5f;
    private float x;
    private bool isGrounded;
    private bool jumpRequested;
    SerializeField private float hookLaunchForce = 10f;

    void Start()
    {
        RB = gameObject.GetComponent<Rigidbody2D>();
    }

    // Update is called once per frame
    void Update()
    {
        x = Input.GetAxisRaw("Horizontal");

        if (Input.GetButton("Jump") && isGrounded) {
            jumpRequested = true;
            Debug.Log("Jump!");
        }

        if (Input.GetKeyDown(KeyCode.L)) {
            launchTowardsHook();
        }
    }

    void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.CompareTag("Ground")) {
            isGrounded = true;
            Debug.Log("Grounded");
        }
    }

    void FixedUpdate()
    {  
        RB.linearVelocity = new Vector2(playerSpeed x, RB.linearVelocityY);

        if (jumpRequested) {
            RB.AddForce(new Vector2(0, jumpForce), ForceMode2D.Impulse);
            isGrounded = false;
            jumpRequested = false;
        }

    }

    void launchTowardsHook()
    {
        Vector2 direction = (GameObject.FindGameObjectWithTag("BasicHook").transform.position - transform.position).normalized;
        Debug.Log("Launch direction: " + direction);
        RB.AddForce(direction
hookLaunchForce, ForceMode2D.Impulse);
    }
}


using UnityEngine;
using UnityEngine.UIElements;


public class PlayerController : MonoBehaviour
{
    private Rigidbody2D RB;
    SerializeField private float playerSpeed = 5f;
    SerializeField private float jumpForce = 5f;
    private float x;
    private bool isGrounded;
    private bool jumpRequested;
    SerializeField private float hookLaunchForce = 10f;


    void Start()
    {
        RB = gameObject.GetComponent<Rigidbody2D>();
    }


    // Update is called once per frame
    void Update()
    {
        x = Input.GetAxisRaw("Horizontal");

        if (Input.GetButton("Jump") && isGrounded) {
            jumpRequested = true;
            Debug.Log("Jump!");
        }

        if (Input.GetKeyDown(KeyCode.L)) {
            launchTowardsHook();
        }
    }


    void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.CompareTag("Ground")) {
            isGrounded = true;
            Debug.Log("Grounded");
        }
    }


    void FixedUpdate()
    {  
        RB.linearVelocity = new Vector2(playerSpeed x, RB.linearVelocityY);

        if (jumpRequested) {
            RB.AddForce(new Vector2(0, jumpForce), ForceMode2D.Impulse);
            isGrounded = false;
            jumpRequested = false;
        }
    }


    void launchTowardsHook()
    {
        Vector2 direction = (GameObject.FindGameObjectWithTag("BasicHook").transform.position - transform.position).normalized;
        Debug.Log("Launch direction: " + direction);
        RB.AddForce(direction
hookLaunchForce, ForceMode2D.Impulse);
    }
}

I know it has something to do with setting the RB.linearVelocity on the fixed update because when I comment that part the launch function works properly.
Maybe its overriding the horizontal velocity? But if so I wouldn't know how to implement basic movement

https://redd.it/1jxrl7k
@r_Unity3D
Problem with BoxCollider on objects
https://redd.it/1jxt2z0
@r_Unity3D
How does my game art style/UI look
https://redd.it/1jxn5wt
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
I was disappointed by the lack of star wars vr games so I decided to make my own.

https://redd.it/1jxwcor
@r_Unity3D
What is the target customer for Synty Sidekick?


I am using synty models for my survival game and since I would like to use mid poly models for main character and npc, the synty sidekick product would be the obvious choice, but then I noticed its pricing model.. a subnoscription..

I am fully supportive with the concept that good assets should be paid for, if you are serious with your own game, but 18$/m seems really steep for a solo indie dev.

I mean I could pay 100$ for a single fully rigged model, and that’s it, even if you go beyond that, I would be spending for other 3 npc.. so price goes up to 400 but it’s a one off, I am not sure with what should happen once you start the sub with Synty, you create the characters and start using those in your game, I would expect one should keep the sub going to have its characters licensed.. once the game is released you still have to pay Synty for the sub? I mean it’s a lot of money without doing anything after the first “making character” phase.

Unless I am missing something?


https://redd.it/1jy136b
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
Got character movement and basic camera working in my first game (still cubes, still learning)

https://redd.it/1jy0tt3
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
Working on an underwater game where an anglerfish is the last hope of a dying ocean. What do you think?

https://redd.it/1jy3e1u
@r_Unity3D