Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Ethan1moody · Apr 13, 2013 at 06:55 PM · objectshorrormovment

Objects move on own

i was wondering if there was any scripts out there for an object to move on its own. i've looked everywhere and i mean everywhere. I am making an indie horror so help would be much apprecitated and thanks for the help.

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 fafase · Apr 13, 2013 at 07:04 PM 0
Share

What do you mean "$$anonymous$$ove on its own"? You need to be a little more specific. For instance, is it just going from A to B? Is it interacting with environment? Is it moving randomly?, Can the player interact with it or even kill it? Should it perform a specific action depending on particular situation? All in all, be a little more specific.

avatar image Loius · Apr 13, 2013 at 07:21 PM 0
Share

"move on its own" is why we have object-oriented program$$anonymous$$g (OOP). Each object should only care about itself and perhaps do some handling on objects related to it (children, parents). This way you can write code for that object so that object will work 'on its own', regardless of how other objects behave.

If you haven't learned about OOP, you'll absolutely want to take some beginner lessons in that (there are plenty of tutorials if you google 'c# oop beginner tutorial'). It's tricky to learn, but it's extremely rewarding once you've got it figured out. Best of luck. :)

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Negagames · Apr 13, 2013 at 08:01 PM

I'm not sure exactly what you're looking for, but this might help. If you are looking to have just have an object simply move through a scene, use you can use rigidbody physics to do that. See: http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.html http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.AddForce.html

Comment
Add comment · 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
0

Answer by Ethan1moody · Apr 18, 2013 at 08:02 PM

I mean by moving on its own by like trigger to set the objectoff to mov on its own and to move a set distance of my choice.

Comment
Add comment · 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
0

Answer by watercat · Apr 16, 2018 at 07:19 PM

if I understood the qustions changes on OnTriggerEnter OnTriggerStey this is c#

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class TeleportExit : MonoBehaviour {
     public Transform targets;
     public Transform ball;
 
     private void OnTriggerExit(Collider theObject)
     {
         {
             ball.position = targets.position;
         }
     }
 } 

Comment
Add comment · Show 1 · 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 watercat · Apr 16, 2018 at 07:23 PM 0
Share

this is js if you want to move protect the side

 #pragma strict
 private var gos : GameObject[];
 private var g : GameObject;
 public var apostasi : int;
 
 function Start () {
     gos= GameObject.FindGameObjectsWithTag("p1"); 
     g=gos[0];
 
 
 }
 function Update () {
 
 }
 function OnTriggerStay (other : Collider){
 
     if(other.gameObject.tag == "Teleport 1"){
         g.transform.position.y+=apostasi;
     }
 }

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

14 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

Related Questions

Multiple Cars not working 1 Answer

I made a better shader how do i fix[add _Shadow Strength]help???>Sorry that im asking for to much 1 Answer

Trigger to make another trigger to appear? 2 Answers

How to make a fog and render distance 2 Answers

Help on importing please 0 Answers


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