r/Unity3D – Telegram
r/Unity3D
266 subscribers
12.7K photos
15.6K videos
14 files
48K links
News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
Download Telegram
How is the movement of so many objects optimized in Survive Squad? ECS or MonoBehaviour?
https://redd.it/1gyq73d
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
Dug out an old project today, always wanted to make a puzzle game, not sure if I should continue with it?

https://redd.it/1gyxlqq
@r_Unity3D
Basics of Unity: 2D Platformer Character Controller (i've finally made something a little more useful than raw unity info)

Here the the repo if youre just after the code (its all free to use)

https://github.com/superbird29/2DCharacterController

The Video

https://www.youtube.com/watch?v=ZVDbjhmdWgY

Here is the tutorial video where I walk you through making a 2D platformer character controller. It's pretty long (26 mins) since I do lots of explaining on the what something does, a little explaining on the why and I cover lots of my own pitfalls. It's also heavily chaptered to all skipping of parts you dont need!

Also it is very important to catch any pitfalls so if you see any let me know.


Let me know if you have any questions or concerns?

If you want a shorter one that just walks you through the code and doesnt opine as much on how to actually do it just let me know below!

I am also taking suggestions for future videos

https://redd.it/1gz40o0
@r_Unity3D
Text is not appearing when i open Unity, is there any way to solve this?
https://redd.it/1gz4vyn
@r_Unity3D
Platformer walljumping when I don't want it to

So I'm kinda new at this and trying to make a simple platformer noscript and I've gotten pretty close to what I want. Issue here is that when the character touches a wall instead of falling it just levitates midair, which allows for it to basically save from every fall by walljumping. Help?

{
//Movement
public float speed;
public float jump;
float moveVelocity;
public Rigidbody2D rb;
bool isGrounded;

void Update()
{
//Grounded?
if (isGrounded == true)
{
//jumping
if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.Z) || Input.GetKeyDown(KeyCode.W))
{

GetComponent<Rigidbody2D>().velocity = new Vector2(GetComponent<Rigidbody2D>().velocity.x, jump);
}

}

moveVelocity = 0;

//Left Right Movement
if (Input.GetKey(KeyCode.LeftArrow) || Input.GetKey(KeyCode.A))
{
moveVelocity = -speed;
}
if (Input.GetKey(KeyCode.RightArrow) || Input.GetKey(KeyCode.D))
{
moveVelocity = speed;
}

GetComponent<Rigidbody2D>().velocity = new Vector2(moveVelocity, GetComponent<Rigidbody2D>().velocity.y);

}
void OnCollisionEnter2D(Collision2D col)
{
Debug.Log("OnCollisionEnter2D");
isGrounded = true;
}
void OnCollisionExit2D(Collision2D col)
{
Debug.Log("OnCollisionExit2D");
isGrounded = false;
}
}

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