When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
10 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
@primal locust
Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!
@primal locust
Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.
using System;
using UnityEditor.Callbacks;
using UnityEngine;
public class JumpPhysics : MonoBehaviour
{
[SerializeField] float jumpHeight
[SerializeField] float jumpforce = 10;
Rigidbody2D rb;
private void Start()
{
rb = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
private void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
float jumpforce = Math.Sqrt(jumpHeight * (Physics2D.gravity.y * rb.gravityScale) * -2)* rb.mass;
rb.AddForce(Vector2.up * jumpforce, ForceMode2D.Impulse);
}
This is C#
what's the difference ?
C++ and C are similar but C# is a bit different
oh so wrong server to ask
Yeah