| https://twitter.com/nicktatorship |
then i told it "if there is a wall between the character and the target pawn, the grenade detonates on it. make it so the character checks for a clear path first. assume they throw it with an arc that is between 30 and 60 degrees."
it adjusted the original code
ChatGPT generated code for the following prompt:
write C++ code for unreal engine to have an enemy character calculate the distance to a target pawn, and whether it is within -5 and 5 degrees of its weapon's forward vector. if it within range, it should call the FireWeapon function. if it is not within range, and the target location is between 600 and 1000 metres, it should turn to face ther target pawn, and call the ThrowGrenade function. if the target pawn is moving towards the character, it should call the Retreat function
I could probably stumble through it in blueprints and lots of googling, and I probably still will, but this... yeah. Of course who knows if its actually right (probably everyone but me!).
Usually one of the first things I do in any project is copy the functions I wrote for doing all the vector A within X of vector B crap that I never remember, but know there's dot products involved. Anyway, got me thinking.