• 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
-2
Question by jazza · Aug 04, 2012 at 11:04 AM · gameobjectaudiocustom

How to make a Slender man follow character script

hi guys i was just wondering if anybody new how to make a script so that the 'slenderman' teleports to positions near the player, and gets closer and closer, sorry for the big ask but could anyone help me out?

Comment
Add comment · Show 4
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 DESTRUKTORR · Aug 06, 2012 at 04:28 PM 4
Share

This is a little bit too much to be asking, I think. If you want to grow, as a programmer, you need to learn some basic problem solving, and try something on your own, first.

Just take a step back and try to figure out what you need to do, overall, then come back and ask questions if your code isn't working right. Good luck!

avatar image jazza · Aug 08, 2012 at 01:20 PM 0
Share

kay, thanks!

avatar image babyjay521 · Feb 11, 2013 at 02:59 AM 1
Share

The basic idea is getting the player's position, and changing the slenderman's position in relation to it. Also, you could use RayCasts to find trees and other items that the slenderman could hide behind, and position him so he is there, etc. But like DESTRU$$anonymous$$TORR said, you will really grow as a programmer if you take on this project by yourself. Trust me, it is much more satisfying to see your own program work than to copy and paste someone else's into your game. Also, you will have a better understanding of the program, and you'll be able to make it to best fit you needs. Hope everything works out well for you! EDIT: Just realized how old this was, sorry to bring it back up haha.

avatar image Unitraxx · Apr 04, 2013 at 12:31 AM 0
Share

I actually can't believe it got -6, it's a well-formed question. Ok maybe not a good question for on UAnswers but there's some real rubbish out there that doesn't even get -1.

6 Replies

· Add your reply
  • Sort: 
avatar image
-1

Answer by DavidRoad · Feb 04 at 02:30 AM

so use this c# code

 using UnityEngine;
 using System.Collections;
 
 public class Enemy : MonoBehaviour {
         public float deathDistance = 0.5f;
         public float distanceAway;
         public Transform thisObject;
         public Transform target;
         private NavMeshAgent navComponent;
         
         void Start() 
         {
             target = GameObject.FindGameObjectWithTag("Player").transform;
             navComponent = this.gameObject.GetComponent<NavMeshAgent>();
         }
         
         void Update() 
     {
             
             float dist = Vector3.Distance(target.position, transform.position);
             
             if(target)
             {
                 navComponent.SetDestination(target.position);
             }
 
             else
             {
                 if(target = null)
                 {
                     target = this.gameObject.GetComponent<Transform>();
                 }
                 else
                 {
                     target = GameObject.FindGameObjectWithTag("Player").transform;
                 }
             }
             if (dist <= deathDistance)
             {
                 //KILL PLAYER
             }
         }
     }


then use this javascript code

 #pragma strict
 
 function Start () {
 
 }
 
 function OnTriggerEnter() {
     Application.LoadLevel("YOUR DEATH SCENE");
 }


Comment
Add comment · Show 2 · Share
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 Daten · Feb 04 at 03:19 PM 0
Share

Jeezus dude, way to necro an almost decade old thread LMAO

avatar image DavidRoad Daten · Feb 07 at 03:25 PM 0
Share

Yeah I Added This Like Decades Ago But I Accidentally Removed It So I Remade It So It May Not Work Now

  • ‹
  • 1
  • 2

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

48 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Slender like game 3 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

GameObject reacts to audio source 1 Answer

Music works but not when accessed by another script in JavaScript 1 Answer

Get acess and switch to many audio source in a single Object HELP!! 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