Equiped toggable flashlight

Get help using Construct 2

Post » Wed Feb 20, 2013 10:25 am

Hi!
I've been making a top down horror game, and the character is supposed to have a toggle able flashlight with on and off, but because the flashlight spawns on the player every tick with the default opaquacy set to 0 setting it on and of won't work. Any examples?
B
5
Posts: 16
Reputation: 457

Post » Wed Feb 20, 2013 11:46 am

The important thing is to have the Layer1 layer Force Own Texture set to Yes.

https://dl.dropbox.com/u/108799982/Capx%20Demos/Torch.capx
Using R238 for all examples
B
60
S
17
G
6
Posts: 363
Reputation: 9,125

Post » Wed Feb 20, 2013 3:56 pm

That's a good example, but what I meant is that the player should be able to switch it on and off. I can't get that to work.

[Edit]: Nvm I already got it working with your example. Thanks.10thGaming2013-02-20 16:01:14
B
5
Posts: 16
Reputation: 457

Post » Wed Feb 20, 2013 4:12 pm

Its almost working now The sprite of the player is aimed towards the mouse, but the light doesn't rotate with it. Heres what I have:
https://dl.dropbox.com/s/bdg40neng5f6e1n/Day-Night_edited-GOOD.capx?token_hash=AAG-PCGGydLLQ-GwrcHZedxGxxr-KulYO_15lb1P7_KClg&dl=1
B
5
Posts: 16
Reputation: 457

Post » Wed Feb 20, 2013 4:25 pm

Maybe you could pin the light to the player using the pin behavior, or you could set the angle of the light to the angle of the player.
B
106
S
35
G
37
Posts: 798
Reputation: 25,215

Post » Wed Feb 20, 2013 4:28 pm

It worked thanks. I had the light connected to the players hands, but by connecting it to the players head it worked. Thanks!
B
5
Posts: 16
Reputation: 457

Post » Wed Feb 20, 2013 5:12 pm

I wanted to try some similar things myself so I had a go at this. Here's the .capx if you're interested:

Flashlight.capx (r119)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: Matthew de and 25 guests