I am implementing a point-click game and trying to get a spawned prefab to follow the mouse Raycast (on a Ground Layer ) until the middle mouse button is clicked, but without much success (at the moment the prefab is not even spawning :( )
Any help would be appreciated, this is how the schematic looks like:

image
  • After few tests with the Ability Battle Animations and the schematic it looks like this schematic might need to be injected when an ability shortcut becomes active.

    Any suggestion how that could be done?
  • That's actually covered by ORK's built-in raycast targeting system, which also has options to spawn a cursor.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Is there a way to control ORK's built-in raycast targeting system when an ability is selected and decide what prefab gets spawned based on the data in the ability?

    I am trying to create a "construction" ability (build defense turret for example)
    The idea is, when an ability is selected, spawning a placeholder prefab that validates the construction location availability based on the mouse position on a Layer and when the ok mouse button is clicked, spawns a final building (if the ground area is free of obstacles).
  • Not directly, but the prefab can use target raycast highlight components for something like this.
    ORK comes with a few built-in example components - e.g. using schematics could be used to handle this. The schematic has the ability/item available as local selected data action.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ok, I added the component Target Raycast Cursor: Schematic and now I have the construction prefab spawning for all abilities :)

    I didn't understand exactly which node I should use in the Start Schematic Asset in order to get the info of the active ability since there are a ton of action related nodes but I can't find a node like "check active ability" or equivalent.
  • The ability is already stored in the local selected data of the schematic and can be accessed via the data key action (the same way as in e.g. schematics animating the action or formulas calculating outcome for it).
    Selected data can be used in many nodes, so it'd depend on what you want to check for - e.g. you can check a variable of the ability via Check Variables node using Selected Data variable origin.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you for the help, I was able to get the schematic access the ability!

    The prefab with the target raycast highlight components has a component (SpawnConstuctionSearchBuilding) with some functions (ex. ActivateSearch() )I'd like to call, what is the right Target Object setup to access them?

    I have tried Starting Object, Machine Object and Selected Data but the function never gets called...

    image
  • Hm ... yeah, I don't think the cursor game object itself is currently available to the schematic.
    I'll look into it.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you Nicholas :)
  • Just checking if there's any update :)
  • Will be in the next update :)
    The schematic cursor prefab components will have access to the cursor's game object via selected data cursor.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you for the update :)
  • edited March 2024
    I just updated ORK with the recent changes and made some progress :)

    I updated the schematic
    The expected behavior would be
    1) activate ability
    2) move mouse around. If I Middle-Click on a valid location (Check function gets that info from a component on the cursor), I can move on to the next schematic and build. Otherwise the ability is stopped.
    Strangely enough it looks like the schematic console registers both inputs (M-Click pressed and not pressed) and interrupts the action.
    This is the schematic:
    image


    And this is how the Mouse Middle-Click input is currently set:
    image
    Post edited by ChimpLogik on
  • Where's the schematic used now?
    If it's via the target raycast cursor component, it would only be used when starting the selection (or stopping when using a stop schematic). So it'd have to be used e.g. via a tick machine to continuously check this - in which case it naturally gets input for not clicked and clicked (though not at the same time).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Right now it's the first schematic in the Battle Animation of the building ability.

    When the ability starts, the schematics reaches out via the Call Function node to the cursor component to check every frame if the area is free of obstacles.
    If so and Middle-Click is pressed, it should move to the next schematic in the in the Battle Animation stack. If the areas is occupied when Middle-Click is pressed, the battle action should stop.

    image

Sign In or Register to comment.