Hey, I am creating a game on my own in Unity 3D but i stuck somewhere. We control a hero in this game and dodging objects which coming from outside in a circle place. But I just did spells which moving to a point from a point. But I want to do objects which spawned random times and random places go towards to the hero and when spawned rotates itself to hero. For example when a spear spawned it will go towards to where the hero is.
Ok
Sure
fair
You are aware “professional” just means someone is getting paid and has nothing to do with actual skill, right?
What you want can be accomplished with these three methods. Use Random.Range to determine when and where to spawn, then use MoveTowards and RotateTowards to move and rotate an object in a certain direction.
https://docs.unity3d.com/ScriptReference/Random.Range.html
https://docs.unity3d.com/ScriptReference/Vector3.MoveTowards.html
https://docs.unity3d.com/ScriptReference/Vector3.RotateTowards.html
This doesn’t require a professional, it requires you posting in “getting started” or maybe the scripting forum.
If i give you a link of discord or teamviewer would you help me? I know these things but I can’t.
Thank you all guys.
nobody help?
With what? You haven’t actually asked any question yet.
I can’t do what I want. I need some live support. I can give u discord if you would help me.
How do I make a spear that goes towards the character’s position when the spear spawned?
@duhanayan34 you don’t need life support. You need learn to use search tools. Internet is full of tutorials an guidelines.
As for discord, Unity has own channel. Go there if you think it may help you. I don’t expect many active professionals there however.
If you have specific questions, search first. If you fail to find an answer, then ask.
As of the spear problem, search moving GameObject keywords.
Also, you should visit Getting Started forum section.
LookAt it’s the thing you want to research and experiment to look always at something.
https://docs.unity3d.com/ScriptReference/Transform.LookAt.html
About the random spawn system, it’s just this:
https://docs.unity3d.com/ScriptReference/Random.Range.html
With this:
https://docs.unity3d.com/ScriptReference/Object.Instantiate.html
With this:
Guys I already have read these pages but i can’t do it. That’s why I am here.
Thanks anyway.
Why not?
I don’t know. Maybe I am incompetent.
Hard true is, programming is not for everyone.
What have you actually tried? What isn’t working? Why haven’t you posted this where it belongs, the Getting Started subforum?