Drag a resource variable from members menu for VS

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Okan Ozdemir

Hi!

I want to drag a member from members menu to Resource Path, and be able to preload it just like below:

extends Node

export (PackedScene) var wp

func _input(event):
	if event.is_action_pressed("click"):
		var new_wp = wp.instance()
		new_wp.position = get_viewport().get_mouse_position()
		add_child(new_wp)

Thanks

:bust_in_silhouette: Reply From: vic.the.developer

I’m not sure I completely understand your question. I created a custom scene which is just a Label, saved it. I then created an export var called custom_label and dragged that scene into it. Then i created the visual script and looked for mouse_down action, upon which I would place an instance of the custom label at the position of the mouse click on the screen. See the screenshot below:

Hi!

That is great, I will try, and also try that with get touch for android possible. Will test and share! Thanks

Okan Ozdemir | 2019-06-08 17:22

Thanks again

What do you mean by mouse_down (action)? I add it in editor but it has no use.

Thanks

Okan Ozdemir | 2019-06-09 09:24

Project > Project Settings > Input Map → Action → type in name mouse_down, hit Add
Now click the + next to the new entry in the list mouse_down, Select Mouse Button, choose the button you want, then click Add.

vic.the.developer | 2019-06-10 15:29

Thanks vic.the.developer! You are great at visual scripting!

Okan Ozdemir | 2019-06-13 03:46