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 CodingNoob · Jan 28, 2015 at 12:05 PM · infinite runnerchase

Creating a chase obejct for 2D infinite Runner

Hey folks,

I want to create a chasing object for a 2D Infinte Runner and could really use some help! I have no clue how to start...

My current state is the following: I have a character which runs automatically to the right and is able to jump. The ground is generated randomly from an array with preFabs in it, each prefab has it's own obstacles set also, and there are also gaps over which the player has to jump. The player moves only on "one" floor (no floating platforms as for e.g. in the Unity Tutorial). The camera always follows the character, so for the player he basically stays at the same position. When hitting an obstacle, the player slows down.

Now, what I want to create, is an enemy which follows the player and if the player collides with it, the game ends. It should also "ignore" obstacles and gaps or jump over them. I'd like that the chase object may only reach the player if he hits to many obstacles in a short amount of time (say 2 in a second), as the player speed increases again after a while.

So, I got the player speed decreasing after a hit, so I thought about making an object, give it a constant speed and make it run to the right as the character. To avoid it colliding with obstacles, I'd use Physics2D.IgnoreCollision with Layers, but how could I achieve taht it jumps over gaps or ignores them? One solution which came in my mind was to create a empty gameobject for every ground prefab and give it a collider which is identical to the first but without gaps and make the object run on this collider. But this would be very time intensive and probably not very good for the performance, too.

Any ideas? Or tutorials on something like that?

I appreciat any kind of help! Thanks in advance!

Best regards

Comment
Add comment · Show 1
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 CodingNoob · Jan 29, 2015 at 07:57 AM 0
Share

I managed to create a chaseobject which follows the player at a constant speed, and which jumps over gaps (tagged the gaps and told the chaseobject to add force when colliding with the tagged floor). But now, I can't get the collision with the player to work for some reason o.O

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

19 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

Related Questions

Enemy AI Problem 0 Answers

3D Infinite runner obstacle creation 0 Answers

Smooth camera follow does not keep up with increasing velocity 0 Answers

Rigidbody2d.velocity making character stop in between 1 Answer

Have Ghost go from Patrolling to Chasing - Pacman 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