Recommended Posts

Start simple, make a monster that exists (and does nothing).

Then gradually expand things in small steps:

- let it walk around randomly

- let it detect the player nearby

- let the player know the monster found him/her (or maybe not, if you want to surprise the player)

- pop up in front of the player (or whatever it should do to scare you).

Share this post


Link to post
Share on other sites
2 hours ago, Alberth said:

Start simple, make a monster that exists (and does nothing).

Then gradually expand things in small steps:

- let it walk around randomly

- let it detect the player nearby

- let the player know the monster found him/her (or maybe not, if you want to surprise the player)

- pop up in front of the player (or whatever it should do to scare you).

Yeh thats the thing you see im having trouble with the script to make it walk around randomly and making a jumpscare but i guess thats a whole other thing to work out

Share this post


Link to post
Share on other sites
41 minutes ago, KnowItAllGames said:

Yeh thats the thing you see im having trouble with the script to make it walk around randomly and making a jumpscare but i guess thats a whole other thing to work out

Walking is easy. If you use Unity then use a script to transform the location.

Next you should place waypoints on a level map, then by moving the monster using a script you target the waypoints. If it's a strait path then there will be no need for complex collision detection.

If you want more complex movement you need to read up on path finding. For your game the simple strait move will be enough.

Edited by Scouting Ninja

Share this post


Link to post
Share on other sites
38 minutes ago, Scouting Ninja said:

Walking is easy. If you use Unity then use a script to transform the location.

Next you should place waypoints on a level map, then by moving the monster using a script you target the waypoints. If it's a strait path then there will be no need for complex collision detection.

If you want more complex movement you need to read up on path finding. For your game the simple strait move will be enough.

You see its set in a forest and i would like my monster to just wander the forest aimlessly until it gets in range of the player(Its not a huge forest)

Share this post


Link to post
Share on other sites

Check the Unity NavMesh for this, remember that when you downloaded Unity it also downloaded the manual and scripting guide. All these things you are looking for is explain in there; keep them open at all times while working with Unity.

 

Now when it comes to navigation meshes Unity is limited, however it has all you will need for a game like yours.

Share this post


Link to post
Share on other sites

Do you have any code to show? Well, first thing did you do pathfinding? It will follow a path and you randomly generate a number for the path you want him to choose, if it see the player then you can make it automatically run to him or jump scare him or you can generate(again) a random number to tell if it has seen the player. If your code doesn't work I can fix it. 

Share this post


Link to post
Share on other sites
1 minute ago, Binkiklou said:

Do you have any code to show? Well, first thing did you do pathfinding? It will follow a path and you randomly generate a number for the path you want him to choose, if it see the player then you can make it automatically run to him or jump scare him or you can generate(again) a random number to tell if it has seen the player. If your code doesn't work I can fix it. 

I've actually just created the NavMesh but im not sure how i get my creature to roam the NavMesh do you think you could help?

also what kind of code would you like me to show you?

Share this post


Link to post
Share on other sites
Just now, KnowItAllGames said:

I've actually just created the NavMesh but im not sure how i get my creature to roam the NavMesh do you think you could help?

also what kind of code would you like me to show you?

Do you have code that you try to make it work? 

Share this post


Link to post
Share on other sites
6 minutes ago, Binkiklou said:

So you need help? Send me what you did and I'll try to finish it.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AIScript : MonoBehaviour {

	public float fpsTargetDistance;
	public float enemyLookDistance;
	public float attackDistance;
	public float enemyMovementSpeed;
	public float damping;
	public Transform fpsTarget;
	Rigidbody theRigidbody;
	Renderer myRender;

	// Use this for initialization
	void Start () {
		myRender = GetComponent<Renderer> ();
		theRigidbody = GetComponent<Rigidbody>();
	}
	
	// Update is called once per frame
	void FixedUpdate () {
		fpsTargetDistance = Vector3.Distance (fpsTarget.position, transform.position);
		if (fpsTargetDistance < enemyLookDistance) {
			myRender.material.color = Color.yellow;
			lookAtPlayer ();
			print ("Look at dah player");
		}
		if (fpsTargetDistance < attackDistance) {
			myRender.material.color = Color.red;
			attackPlease ();
			print ("Attack");
		} else {
			myRender.material.color = Color.blue;
		}
	}

	void lookAtPlayer(){
		Quaternion rotation = Quaternion.LookRotation (fpsTarget.position - transform.position);
		transform.rotation = Quaternion.Slerp (transform.rotation, rotation, Time.deltaTime * damping);
    }

	void attackPlease(){
		theRigidbody.AddForce (transform.forward * enemyMovementSpeed);

	}
}

This is my movement code for my creature and its all i have towards actually making it actually roam the NavMesh

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Announcements

  • Forum Statistics

    • Total Topics
      628333
    • Total Posts
      2982127
  • Similar Content

    • By BAG Labs
      Mobile SoS

      Platform: Android
      Genre: Board
      Link: Google Play
       
      This games sharpen memory and test your strategies to place S-O-S pattern within time limit and serve 3 difficulties as Easy, Normal, and Hard.

      Goals of the game is to put S-O-S words in patterns (Horizontal, Vertical, and Diagonal) alternately with enemy.
       
      Features:
      Single Player Multiplayer Achievements Leaderboards  
       
      Screenshot:

       

       

       
      Link: Google Play
       
      Please help us improve this game with review
    • By Djinotan
      Hello, my name is Dmitry and I am composeur and sound designer. I am new on this forum, but I write music for 4 years.
      Mail - motorindmitry87@gmail.com
      Skype - Djino1208
      Facebook - https://www.facebook.com/profile.php?id=100004161284063
      All my music you can find here -
      Intro for A.S.H. indie game - 
       
      A.S.H. Gamplay - 
    • By abarnes
      Hello!
      I am a game development student in my second year of a three year program and I would like to start building my portfolio. I was thinking of creating some games to show what I can do to potential employers since I wont have any work related experience when I graduate. But as I'm sure you all know there are tons of ways to approach developing/designing a game and I'm curious if anyone had any insight as to any "standards" that come with this? Is it okay to use game engines like Unity, Unreal, Game Maker etc? Or would it be better to make a game from scratch to better show case your skills? Any and all advice will be greatly appreciated!
    • By Mr McDurp
      lately I've been working on some ideas for a Game in construct 2 but my biggest setback is art. I have no skill in that aspect of things. I am looking to collaborate with an artist(not necessarily Professional) to bring some ideas to life. plz respond if interested
    • By Hilster
      Hello 2D Artists,
      I've started making a 2D Puzzle Adventure game for mobile and I'm looking for someone who would want in on creating assets for the game. The core of the programming is pretty much complete, you can walk within the grid laid out and push boxes, when there is an object on top of a pressure pad it will activate the linked objects or if there is one object with multiple linked pressure pads it requires you to activate all points for the object to become active. 

      The level iteration for the game is quick and simple, a Photoshop file that is made of individual pixels that represents objects is put into the game and it creates the level out of those pixels with the assigned objects.
      The objects that need sprites created so far is the character, box, pressure pad, door, trap door, the walls, the stairs and the tiled background.
      I intend to add more objects so the amount I'd like to add will be extended.
      My motivations for posting here is to have something that looks nice to be able to display on my portfolio, so if you're looking for a working game that you can place your art into and improve the look of your portfolio then we're in business.
      Please reply with a few past examples of your art below and I'll be in touch!
  • Popular Now