Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Benifir · Oct 09, 2012 at 12:14 PM · aifollowteleporthorror

AI Script Problem, Horror Game

I'm currently in the process of making a horror game with a story to it. It's not just pointless wet yourself then never touch the mouse again. It's follow the story, enjoy the motivations, then wet yourself a few times. I'm a 3D artist making the map (A replica of a few blocks of a real town located in south weber utah. Very high poly) and thats the problem. I'm missing a very important AI script. I've made my own but really first day trying scripting and im having problems with it.

 var target : Transform; //the enemy's target
 var moveSpeed = 3; //movespeed
 var stopSpeed = 0;
 var rotationSpeed = 3; //speed of turning
 
 var myTransform : Transform; //current currents transform data of this enemy
 
 function Awake()
 {
     myTransform = transform; // cach transform data for easy accessperformance
     
 }
 function Start ()
 {
     target = GameObject.FindWithTag("player").transform; //target the player
     
 }
 
 function update () {
 
     var Speed = moveSpeed;
     
     if (renderer.isVisible)
     {
     myTransform.Position += myTransform.forward * stopSpeed * Time.deltaTime;
     }
     
     if(!renderer.isVisible)
     {
     myTransform.Position += myTransform.forward * moveSpeed * Time.deltaTime;
     }
     //rotate to look at the player
     myTransform.rotation = Quaternion.Slerp(myTransform.rotation,
     Quaternion.LookRotation(target.Position - myTransform.Position), rotationSpeed*Time.deltaTime);
     
     
 }
 
 //if you are looking at the object...
 if (renderer.isVisible)
 {
 move = false;
 }
 
 //if you are NOT looking at the object...
 if(!renderer.isVisible)
 {
 move = true;
 }
 //if you are not looking at the object...
 if(move)
 {
 //make him look at the target
 transform.LookAt(target);
 //always follow the target
 myTransform.position += myTransform.position.straight * moveSpeed * Time.deltaTime;
 }
 
 //if he is 3 units away from something, move right (works if you are not looking at the object)
 if (Physics.Raycast (transform.Position.forward) && move)
 {
 Debug.Log("Something ahead, moving");
 transform.Translate(Vector3.right * 3 * Time.deltaTime);
 }

I need it to be like a slenderman sort of AI. Meaning, i need my enemy to stalk, teleport, and appear at a selected game object(e.g. behind door in a closet). My script doesn't have all i need and its junk anyways. ill just stick to modeling. I would really appreciate any help anybody can give, and if you come up with a script i;ll put your name in the credits.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Oct 09, 2012 at 12:16 PM 1
Share

So many Slender Questions! I am ready to make a tutorial just to stop them! And so it cannot be said that I wasn't constructive or helpful, everything you want is here :

http://answers.unity3d.com/questions/287355/slender-like-game.html

http://answers.unity3d.com/questions/296068/how-to-make-a-slender-man-follow-character-script.html

http://answers.unity3d.com/questions/319733/how-to-make-enemy-kill-you-if-starring-at-it.html

http://forum.unity3d.com/threads/134862-Slender-$$anonymous$$an-Design-Outline

http://www.parsecproductions.net/slendermangame.txt

http://forum.unity3d.com/threads/141488-Slender-Beta-0.9

http://forum.unity3d.com/threads/138399-Slender-$$anonymous$$an-WIP

It's up to you to find the useful information among that. Read.

Break it down to one simple thing. Work out how to find if one object can "see" another. Once you do that, you can make it do anything you like with that as a trigger. And you can do it both for the player and the 'man' .

http://answers.unity3d.com/questions/239927/Collecting-Papers-and-$$anonymous$$eeping-Track-of-how-many-collected--need-help.html

http://answers.unity3d.com/questions/323129/if-anyones-looking-for-a-flashlight-script-with-a.html

http://answers.unity3d.com/questions/316189/i-want-to-turn-my-flashlight-on-and-off-while-stil.html

http://www.youtube.com/watch?v=nmvCaqNGEFU&feature=related

http://answers.unity3d.com/questions/15438/trying-to-pick-up-and-see-paper-pop-up-gui-window.html

http://answers.unity3d.com/questions/321749/how-do-you-pick-up-pages-like-in-slender.html

http://cgcookie.com/unity/2011/12/05/introduction-to-character-controllers/

http://unity3d.com/support/resources/assets/terrain-assets

http://unity3d.com/support/resources/unity-extensions/terrain-toolkit

avatar image Benifir · Oct 09, 2012 at 12:26 PM 0
Share

Thanks, I'll take a look at it. And I'm not making another slender game :p I think there is plenty going around about that

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

ai spot you with flashligt on!!! 1 Answer

Problems with simple AI script 3 Answers

Change AI Follow Players 1 Answer

Timer activates script 1 Answer

How to create a basic follow AI 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges