Be the first to post for 'Automatic Repeat Attacking'!

If you’re reading this, there probably aren’t very many posts yet. But don’t worry, you can be the first! Either create a new post or just reply to this one to say ‘hi’.

1 Like

I followed it along but my enemy always has around 3/4 of his hp when game starts and my character no longer plays any animation or deals damage.

Does anyone know how to make transform.LookAt(target.transform); turn more smoothly?

Try putting it in LateUpdate() rather than ‘Update()’

Hi guys,

I have never been so stumped before in my coding experience. The video we just went through didnt even seem that difficult I cant explain what is going wrong. My get components are not working correctly. I have triple checked all of my scripts to bens and they are all almost exactly the same. I have null reference exceptions all over the place. Could monodevelopment be cracking on me?

Is there anyway I can upload my project in its entirety and have someone take a look at it?

First step it to make sure you have the latest Unity (2017.3 is good) and the latest Visual Studio if thats what you’re using. We’ve seen some odd issues if you have old versions of either. And if you paste in your code and some screenshots we can take a look.

Is there a reason why we need the whole isTimeToHitAgain functionality when we are already using timeToWait as our return Waitforseconds? It’s possible that I’m thinking about this differently since I intend to add colliders to my weapons and have them do damage that way instead of this time hacking stuff we’re wrapping over it.

Dimi, for starters, look at using a Lerp (linear interpolate) or Slerp (spherically interpolate) function to get a more gradual turn on the character. However, you’ll probably find this will look strange, as the character will turn without moving his feet.

If you look at the Character class Move function, and analyze how it works, you’ll find you can create a similar function that only turns the character, and this will move the character’s feet when they turn so it looks a lot more natural. Hope that helps!

Privacy & Terms