[Unity 2019.41of1] C# 2D Galaga Clone Project

Hello internet,

I need assistance debugging some code I am trying to write. Listed below is code I am writing.
Note: I am trying to write player movement for an android phone, what you see listed may not reflect the proper terms for the phone.

using System.Collections;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{

}
// Update is called once per frame
void Update()
{
Input.GetAxis(“Horizontal”);

Vector3 pos = transform.position;
pos.x = 2f;
transform.positon = pos;
}
}

Errors I receive are as follows;

  1. Assets\Scripts\PlayerMovement.cs(19,19): error CS1061: ‘Transform’ does not contain a definition for ‘positon’ and no accessible extension method ‘positon’ accepting a first argument of type ‘Transform’ could be found (are you missing a using directive or an assembly reference?)

Thank you!

@chaseagoldsmith

‘Transform’ does not contain a definition for ‘positon’

That is your problem - there is no “positon” in transform.

Also, this is a generic scripting question, not a 2D feature related question.

Could you please also edit your post to use code tags? Here you can find information how to do it: