#im a complete beginner and have issue with the serializeField thing

10 messages · Page 1 of 1 (latest)

crisp harborBOT
#

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

Screenshots!

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 Do Not Delete Posts!

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.

primal locust
#

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);
    }
real wedge
#

This is C#

primal locust
#

what's the difference ?

real wedge
#

C++ and C are similar but C# is a bit different

primal locust
#

oh so wrong server to ask

real wedge
#

Yeah