This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

0
The value of AI for coding and learning?
Post Body

I've heard hundreds of opinions about the use of AI, both for and against (including some I outright disregard, like an actual software engineer who swore that his job would be obsolete in years)

I think the balanced view is that it can be used as a tool but doesn't replace actual knowledge.

Case in point : last night I was using ChatGPT to script some stuff. I could do by hand but I wanted to see what the AI would come up with.

I encountered a point in which I added a new script and it broke my movement. Couldn't figure out why. I asked Google and Chat, no conclusive answers. I messed around and fixed it (can't remember how)

Then I added a new shooting script which didn't send my projectiles flying to the right, even though it was in the code. Chat didn't provide any answers.

(these are the highlights, lots of minor stuff I Googled)

I'm not sure how much of this is AI, and how much of this is just actual normal gamedev stuff (it should work but it doesn't) so I thought I would ask to learn and discuss.


Code for reference :

```

using UnityEngine;

public class BulletController : MonoBehaviour

{

public float speed = 10f; // Speed of the bullet

public int damage = 1; // Damage inflicted on enemies

Rigidbody2D rb; // Reference to the Rigidbody2D component

void Start()

{

rb = GetComponent<Rigidbody2D>(); // Get the Rigidbody2D component of the bullet

rb.velocity = transform.right * speed; // Set initial velocity to move the bullet horizontally to the right

}

void OnTriggerEnter2D(Collider2D other)

{

// Check if the bullet collided with an enemy

EnemyController enemy = other.GetComponent<EnemyController>();

if (enemy != null)

{

enemy.TakeDamage(damage); // Call the TakeDamage method on the enemy

Destroy(gameObject); // Destroy the bullet on collision with an enemy

}

}

void Update()

{

// Destroy the bullet if it goes out of the screen (optional)

if (transform.position.x > 10f || transform.position.x < -10f)

{

Destroy(gameObject);

}

}

}

```

Author
Account Strength
50%
Account Age
1 year
Verified Email
Yes
Verified Flair
No
Total Karma
2,174
Link Karma
1,793
Comment Karma
381
Profile updated: 2 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 months ago