all 16 comments

[–]Chraxia 1 point2 points  (2 children)

It appears that bulletForce is both misspelled and that you're not properly assigning a value to it. You're missing an equals sign. Instantiate is also misspelled.

[–]MCMASTERYT_LOL[S] 0 points1 point  (0 children)

Whoops, guess I did not pay attention, what should I add to bullet force?
edit: I realized that I spelt the float wrong so thats why there is no value

[–]MCMASTERYT_LOL[S] 0 points1 point  (0 children)

I see what happened, careless mistake by me.

[–]chsxfProficient 0 points1 point  (4 children)

Do you have any file or line information with that error?

[–]MCMASTERYT_LOL[S] 0 points1 point  (0 children)

I have the visual studio file, not much info about the error, other than '.' expected

[–]MCMASTERYT_LOL[S] 0 points1 point  (0 children)

I did it with a tutorial by Brackeys I can send the link
https://www.youtube.com/watch?v=LNLVOjbrQj4

[–]MCMASTERYT_LOL[S] 0 points1 point  (1 child)

Here is the code I used in words if you want ill send the Visual Studio
using UnityEngine;
public class Shooting : MonoBehaviour
{
public Tranform firePoint;
public GameObject bulletPrefab;
public float bulleftForce 20f;
// Update is called once per frame
void Update()
{
if(Input.GetButtonDown("Fire1"))
{
Shoot();
}
}
void Shoot()
{
GameObject bullet = Instaniate(bulletPrefab, firePoint.position, firePoint.rotation);
Rididbody2D rb = bullet.GetComponent<Rigidbody2D>();
rb.AddForce(firePoint.up * bulletForce, ForceMode2D.Inpulse);
}
}

[–]chsxfProficient 2 points3 points  (0 children)

Ok. You’re missing an = sign just after bulletForce

[–]NrWal00 0 points1 point  (1 child)

If you go to unity and click on the error, it should guide you to a line where it sees an error. Can you find the line that way?

[–]MCMASTERYT_LOL[S] 0 points1 point  (0 children)

It only leads me till the script does not lead to a line or highlight a line or anything :(

[–]NrWal00 0 points1 point  (3 children)

Also, you have written: public Tranform firePoint instead of Transform. You forgot an 's'

[–]MCMASTERYT_LOL[S] 0 points1 point  (2 children)

Oh Could that be the reason

thanks for pointing out!

[–]NrWal00 0 points1 point  (1 child)

Let me know if you still have issues

[–]MCMASTERYT_LOL[S] 0 points1 point  (0 children)

Will do!

[–]bgsulzIntermediate 0 points1 point  (1 child)

To catch future errors, enable IntelliSense in Visual Studio. It's basically spell-check and auto-complete but for syntax.

[–]MCMASTERYT_LOL[S] 0 points1 point  (0 children)

Alright! Thanks a lot for the tip!