2
$\begingroup$

In follow up to this problem, I am having an issue. Look over that question, and the correct .blend file is included there. I replicated the logic there to have everything the same. An empty is supposed to be in the center of my screen when it collides with certain objects. For my .blend, when I move my mouse over an object it is supposed to track to, it tracks to it. There is an issue though: if I keep my mouse in that object and keep moving, the empty will not track again. In other words, the first time I look over an object, the empty will track there and will not continue tracking unless I go to another object. If you look at the .blend in the other question, and add a cube ontop of the empty that is a child of the empty just to see where the empty is, everything is flawless. If you look over an object, it tracks there. If you keep looking around within the object, it keeps updating. I tried to explain this the best I can, and I hope you understand. How can I have it constantly updating its position rather than every time I look over a new object? Thanks!

EDIT: Just to avoid confusion and the fact that my other question's .blend is old, both .blends [good and bad] will be below, and you can see for youselves:

The incorrectly working .blend.

The working .blend.

Take a look at both .blends, they both generally have the same concept. If you still do not understand, the best way to understand is to do the following: download both .blends, and move your mouse over a wall or a cube in the game; keep your mouse on the object and move around still within the object. For the working .blend, drag your mouse across the floor and notice how it updates quickly. For the incorrectly working one, drag your mouse across a cube and notice how it tracks once and only once unless you go over another object.

$\endgroup$
4
  • $\begingroup$ @Chebhou I don't understand how some of you guys are so smart with these things. I literally spent so much time explaining that in hopes of someone atleast understanding. You just fixed my issue: write an answer if you'd like so I can upvote and check. Thanks! $\endgroup$
    – blackhole
    May 7, 2015 at 0:56
  • $\begingroup$ because we are so stupid in lot of things $\endgroup$
    – Chebhou
    May 7, 2015 at 1:02
  • $\begingroup$ What do you mean "you guys". only @Chebhou is so smart on these things... $\endgroup$
    – ruckus
    May 7, 2015 at 4:14
  • $\begingroup$ no offence everyone here.:) $\endgroup$
    – ruckus
    May 7, 2015 at 4:14

1 Answer 1

2
$\begingroup$

You have to keep the script running all the time, it is better to have an always sensor in pulse mode attached to the Python controller :

enter image description here

or just activate the pulse mode on the ray sensor to keep activating the script even if the hitObject is the same :

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .