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:
Any suggestion how that could be done?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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).
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.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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.
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.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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...
I'll look into it.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The schematic cursor prefab components will have access to the cursor's game object via selected data cursor.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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:
And this is how the Mouse Middle-Click input is currently set:
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).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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.