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
1
Question by del_pimpo · Oct 28, 2011 at 02:01 AM · javascriptplatformerledge

2.5D ledge hang with javascript

Hi there people.

I am trying to construct a script which will allow my character to jump up to a cube, cling to the edge and then allowed to jump up.

I am unsure how I would go about this for 2.5.d

how would I raycast from the top of the cube and the player detect it ?

heres what ive got so far - which is not working for me

 var ledge : Vector3;
 
 var Edge = transform.TransformDirection(Vector3(1,0,0));
 
 var hit : RaycastHit;
 
 
 function Update(){
 
 Debug.DrawRay(transform.position, -Edge*1, Color.blue);
 
 
 
 if(Physics.Raycast(transform.position, -Edge, hit,2)){
 
       hit.gameObject.SendMessage(transform.position.x, ledge);
 
 
 }
 
 }

I would appreciate some advice on this as everything Ive found so far is all about 3d platformers which I cannot make sense of.(fairly new to unity coding still)

Cheers

Comment
Add comment · Show 9
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 gfr · Oct 28, 2011 at 02:18 AM 0
Share

What does 2.5D mean in your case? Sidescroller-like, isometric, ...?

avatar image caroparo · Oct 28, 2011 at 02:53 AM 0
Share

Yeah, is it really 3D but viewed from a fixed camera? Or isometric 2D graphics illustrated in a way that is 3D-like? They can make a lot of difference regarding your Collider which the Raycast should hit. Does the Raycast hit?

avatar image del_pimpo · Oct 28, 2011 at 03:56 PM 0
Share

yeah its a fixed camera platformer sidescroller - really just a 2d view but using 3d objects - and the raycast doesnt hit. Id appreciate your help ppl cheers

avatar image del_pimpo · Oct 28, 2011 at 04:09 PM 0
Share

forgot to mention the raycast doesnt even appear in scene view when i run the game

avatar image LegionIsTaken · Oct 28, 2011 at 04:57 PM 0
Share

Just a note. There is no need to multiply a variable by one, it changes nothing. x*1 = x.

Show more comments

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Cube terrain with perlin noise 1 Answer

I need help with my Door Switch Configuration. 1 Answer

attract particles 3 Answers

Every 0.5 sec there is a 10% chance of a target spawning. 2 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