Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'object distance'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • unity3D | Example Projects
    • unity3D | Scripts
    • unity3D | Shaders
    • unity3D | Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • FREE FPS PROJECT
    • FPSKit Download
    • FPSKit Modifications/Tutorials
    • FPSKit WIP/Showcase
    • Discussions / Bug reports
  • SELL | REQUEST
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase

Categories

  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 1 result

  1. Hi there! I'm new to Unity and having trouble figuring out this issue, there is clearly a huge gap in my understanding. What I'm trying to do is to create "distance floats" by calculating the distance between the 6 game objects and my player object. I then want my PdDataHandler Script to print these to the console (and maybe send these values as OSC messages). If this seems silly or counter-intuitive to anyone, please push me in the right direction!! My googling revealed that the problem is related to attempting to call on things that are a part of a class instead of an object but I still don't really understand. Any help would be greatly appreciated. edit: I should also mention that the Player and WhitePetalFlower exist on their own object scripts (WhitePetalFlower's script only defines it as a class, nothing more) using UnityEngine; using System.Collections; public class PdDataHandler : MonoBehaviour { public float WhitePetalFlowerDist; public float BluePetalFlowerDist; public float RedPetalFlowerDist; public float WhiteRoundFlowerDist; public float YellowRoundFlowerDist; public float PinkRoundFlowerDist; void Start () { } void Update () { WhitePetalFlowerDist = Vector3.Distance (Player.transform.position, WhitePetalFlower.transform.position); print("Distance to WhitePetalFlower: " + WhitePetalFlowerDist); BluePetalFlowerDist = Vector3.Distance (Player.transform.position, BluePetalFlower.transform.position); print("Distance to BluePetalFlower: " + BluePetalFlowerDist); RedPetalFlowerDist = Vector3.Distance (Player.transform.position, RedPetalFlower.transform.position); print("Distance to RedPetalFlower: " + RedPetalFlowerDist); WhiteRoundFlowerDist = Vector3.Distance (Player.transform.position, WhiteRoundFlower.transform.position); print("Distance to WhiteRoundFlower: " + WhiteRoundFlowerDist); YellowRoundFlowerDist = Vector3.Distance (Player.transform.position, YellowRoundFlower.transform.position); print("Distance to YellowRoundFlower: " + YellowRoundFlowerDist); PinkRoundFlowerDist = Vector3.Distance (Player.transform.position, PinkRoundFlower.transform.position); print("Distance to PinkRoundFlower: " + PinkRoundFlowerDist); } }
×