Hope this code helps anything, also if you have any better player controller scripts, if you would like you can comment it because, like i said, any help is apreciated:)
edit: Forgot to mension that i cant jump wile mooving.
Hello im a beginner and was wondering if there is any exercises i could do to improve or any other tips you have. English isint my first language so im sorry if my grammar is bad. Thank you!😊
hello im a beginner and i came across this subbreddit. i thought that this will be a good place to start improving my skills. English isint my first language so if my grammar is bad i am sorry.
I was wondering if you guys have any tips for me to improve. I will be looking at your entrys to again improve my drawing skills and maybe one day i will post my entry on here aswell and when i do feel free to tell me something i can improve on
the drawing! as much as i have seen this subreddit is a kind one. Im looking forward to be a part of this and seeing the amazing artists in the world.😁
ok thanks!
character, if i move while in the air, instaid of doing like a normal jump it glides
Oops wrong code, i hope that was not an effortless question i did not actually see the rules before but here are the codes:
Jump script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
public class Jump : MonoBehaviour {
public bool isGrounded;
Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void OnCollisionEnter(Collision Col)
{
if (Col.gameObject.tag == ("Ground") && isGrounded == false)
{
isGrounded = true;
}
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
{
rb.AddForce(new Vector3(0, 5, 0), ForceMode.Impulse);
isGrounded = false;
}
}
}
Movement script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
Rigidbody rb;
public float speed = 10.0f;
void Start() {
rb = GetComponent<Rigidbody>();
rb.freezeRotation = true;
}
void Update() {
if (Input.GetKey(KeyCode.D))
{
rb.velocity = transform.right * speed;
}
if (Input.GetKey(KeyCode.A))
{
rb.velocity = -transform.right * speed;
}
if (Input.GetKey(KeyCode.W))
{
rb.velocity = new Vector3(0, 0, 1) * speed;
}
if (Input.GetKey(KeyCode.S))
{
rb.velocity = new Vector3(0, 0, -1) * speed;
}
}
}
Hope this code helps anything, also if you have any better player controller scripts, if you would like you can comment it because, like i said, any help is apreciated:)
edit: Forgot to mension that i cant jump wile mooving.
just a quick question what program can i use to make 2D sprites or 3D characters. I know that blender is a free 3D character making tool.
holy crap i was not expecting people to actually helpXD Thank you for the help!
Hello im a beginner and was wondering if there is any exercises i could do to improve or any other tips you have. English isint my first language so im sorry if my grammar is bad. Thank you!😊
hello im a beginner and i came across this subbreddit. i thought that this will be a good place to start improving my skills. English isint my first language so if my grammar is bad i am sorry. I was wondering if you guys have any tips for me to improve. I will be looking at your entrys to again improve my drawing skills and maybe one day i will post my entry on here aswell and when i do feel free to tell me something i can improve on the drawing! as much as i have seen this subreddit is a kind one. Im looking forward to be a part of this and seeing the amazing artists in the world.😁
End of this list.
Back to top