- Home /
Must Change API for script to work?
In one of my projects, (the one I reference in my post earlier today) I found changining the script rendering works, on later inspection,I noticed it only works when I switch my script rendering. I'll have it on >NET star, it will work, i play again on .NET star, it does not, i have to switch to 4.x and the same thing happens, is this something i should worry about, or just a minor annoyance? please help!
oh, BTW, if Input.Get$$anonymous$$ey statements are only effected by this, forward motion ect. should all work fine, if anything else specific has this problem i will update via comments.
There's not enough information here to really help you at all, aside from something like "hey your script probably uses features from a newer version of c#".
What isn't working? It's probably telling you a line with syntax it can't understand, ya?
@TreyH here is the script if it helps. using System.Collections; using System.Collections.Generic; using UnityEngine;
public class movement : $$anonymous$$onoBehaviour { public float speed; public float JumpPower; private float moveInput;
private Rigidbody2D rb;
private bool faceRight = true;
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
void FixedUpdate()
{
moveInput = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(moveInput * speed, rb.velocity.y);
if(faceRight == false && moveInput > 0)
{
Flip();
}
else if(faceRight == true && moveInput < 0)
{
Flip();
}
}
void Flip()
{
faceRight = !faceRight;
Vector3 Scaler = transform.localScale;
Scaler.x *= -1;
transform.localScale = Scaler;
}
}
and here is a video for further explanation: https://youtu.be/Wyfj14LA4m$$anonymous$$
Your answer

Follow this Question
Related Questions
Desktop Virtual Goods Store 0 Answers
A Google Play Game Services Unity Plugin for ios 0 Answers
How to implement Amazon Gamecircle 2 Answers