How to move object at random direction,that changes after some amount of time?

Hi…I am new to unity…how to move an object at random direction,that changes after some amount of time ,also random, and they need to cast a single ray to avoid obstacles (ray casting).

I need script in java script and c#…

Hello there, and welcome to Unity Answers!

Here are some links to get you started on your journey:

Good luck, and feel free to create a new question (ideally with some of your code) if you get stuck.