Forum rules - please read before posting.

getting the coordinates of a scene Object

From a custom script I place in two AC.GlobalVariables the Z and Y coordinates of an Object I pickup with a Raycast.
Once back in AC I want to compare these coordinates (float variables) against a number of GameObjects (Quads) to see if they are identical and if so do something.

I don't see any actionLists that could read the coordinates of existing on-scene objects. 

Do you have any suggestion on how to do this.

Comments

  • edited June 2017
    Hi @joesan,
    You might want to write your own custom Action.

    Take a look at the section 12.3 - CUSTOM ACTIONS of the manual.


  • Custom script or Action that goes through an array of GameObjects and compares their Z/Y co-ordinates with the variable values.

    float storedZValue = AC.GlobalVariables.GetFloatValue (2);
    float storedYValue = AC.GlobalVariables.GetFloatValue (3);

    Where 2 and 3 are example ID numbers of the Variables that store the Z and Y co-ordinates respectively.
  • I must have not exposed my question well enough.

    I've been using AC.GlobalVariables dozens of times already and your suggestions are the ones I have done already. Let me repeat my question hoping it is clearer this time:

    I already have in my scene the Z and Y variables that are set via a custom script as a result from a Raycast .
    Now I have in my scene  let's say 3 Cube Objects and I want to find out which Cube's Z and Y coordinates are equal to what I have brought  in the AC.GlobalVariables.

    My question is then that I wanted to find out whether there is an ActionList that shows the coordinates of an Object like you have with, for instance, the Object:Transform which can set Scale, Translate, Rotate but what about Get the coordinates of an Object?

    I could work it out using more custom scripts that would be not a problem but I don't have just 3 cube Objects but 132 of them you can imagine the difficulties then.
  • A custom script would be even more appropriate in that case.  An Action that checks the transform values of a single object would still need to be repeated for the number of objects you have to check, so if you have 132 of them to go through then a custom check is always going to be the better option.

    My first suggestion still applies to your new explanation - a custom script could go through an array of objects (either defined manually or automatically generated e.g. by collecting all objects with a certain tag) and then compare each one's co-ordinates with the values stored as Global Variables.
  • Yes I agree. I have changed the approach to the problem thanks to "discovering" how to hit an Object  behind another with a Raycast so I can get the location of the object behind which is the one that being 'hidden' was now visible. Of course you know I am referring to Layouts.

    I like your AC and would like to use only that but it makes sense that not everything can be done with it my problem is I am not yet experienced with c#...................  but getting there.
    Thanks.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.